<h1>EDI API</h1>
<a name="Extensions"></a><h2>Extensions</h2>
  <table class="apiIndex" title="Extensions">
<tr class="apiDef">
<td class="apiName"><a href="#group___edi" class="nameRef">Edi</a></td>
<td class="apiBrief">Database structure.</td></tr>
<tr class="apiDef">
<td class="apiName"><a href="#group___edi_field" class="nameRef">EdiField</a></td>
<td class="apiBrief">EDI Record field structure.</td></tr>
<tr class="apiDef">
<td class="apiName"><a href="#group___edi_grid" class="nameRef">EdiGrid</a></td>
<td class="apiBrief">Grid structure.</td></tr>
<tr class="apiDef">
<td class="apiName"><a href="#group___edi_rec" class="nameRef">EdiRec</a></td>
<td class="apiBrief">Database record structure.</td></tr>
<tr class="apiDef">
<td class="apiName"><a href="#group___edi_service" class="nameRef">EdiService</a></td>
<td class="apiBrief">Edi service control structure.</td></tr>
</table>
<a name="Functions"></a><h2>Functions</h2>
  <table class="apiIndex" title="Functions">
<tr class="apiDef"><td class="apiType">int</td><td><a href="#group___edi_1gafac7f959a214551acc56fd42a8c0e04e" class="nameRef">edRemoveColumn</a>(<a href="#group___edi" class="ref">Edi</a> *edi, <a href="osdep.html#group___osdep_1ga0f128c3e0c83721af0220c00554e9c4e" class="ref">cchar</a> *tableName, <a href="osdep.html#group___osdep_1ga0f128c3e0c83721af0220c00554e9c4e" class="ref">cchar</a> *columnName)</td></tr><tr class="apiBrief"><td>&nbsp;</td><td>Remove a column from a table.</td></tr>
<tr class="apiDef"><td class="apiType">int</td><td><a href="#group___edi_1gab66595c455e15000e812ec830acce7d9" class="nameRef">ediAddColumn</a>(<a href="#group___edi" class="ref">Edi</a> *edi, <a href="osdep.html#group___osdep_1ga0f128c3e0c83721af0220c00554e9c4e" class="ref">cchar</a> *tableName, <a href="osdep.html#group___osdep_1ga0f128c3e0c83721af0220c00554e9c4e" class="ref">cchar</a> *columnName, int type, int flags)</td></tr><tr class="apiBrief"><td>&nbsp;</td><td>Add a column to a table.</td></tr>
<tr class="apiDef"><td class="apiType">void</td><td><a href="#group___edi_service_1ga81c6f760f0e529fb91868fc2caddcec8" class="nameRef">ediAddFieldError</a>(struct EdiRec *rec, <a href="osdep.html#group___osdep_1ga0f128c3e0c83721af0220c00554e9c4e" class="ref">cchar</a> *field, <a href="osdep.html#group___osdep_1ga0f128c3e0c83721af0220c00554e9c4e" class="ref">cchar</a> *fmt, ...)</td></tr><tr class="apiBrief"><td>&nbsp;</td><td>Add a field error message.</td></tr>
<tr class="apiDef"><td class="apiType">int</td><td><a href="#group___edi_1gaa6413f84f22899c4ae15e8ac3f477f56" class="nameRef">ediAddIndex</a>(<a href="#group___edi" class="ref">Edi</a> *edi, <a href="osdep.html#group___osdep_1ga0f128c3e0c83721af0220c00554e9c4e" class="ref">cchar</a> *tableName, <a href="osdep.html#group___osdep_1ga0f128c3e0c83721af0220c00554e9c4e" class="ref">cchar</a> *columnName, <a href="osdep.html#group___osdep_1ga0f128c3e0c83721af0220c00554e9c4e" class="ref">cchar</a> *indexName)</td></tr><tr class="apiBrief"><td>&nbsp;</td><td>Add an index to a table.</td></tr>
<tr class="apiDef"><td class="apiType">void</td><td><a href="#group___edi_service_1ga7c605c7761d7a46a207cb6dd0f71b372" class="nameRef">ediAddProvider</a>(struct EdiProvider *provider)</td></tr><tr class="apiBrief"><td>&nbsp;</td><td>Add a database provider.</td></tr>
<tr class="apiDef"><td class="apiType">int</td><td><a href="#group___edi_1gad0cad6a7fe8e2568923e47d6e9085ed4" class="nameRef">ediAddTable</a>(<a href="#group___edi" class="ref">Edi</a> *edi, <a href="osdep.html#group___osdep_1ga0f128c3e0c83721af0220c00554e9c4e" class="ref">cchar</a> *tableName)</td></tr><tr class="apiBrief"><td>&nbsp;</td><td>Add a table to a database.</td></tr>
<tr class="apiDef"><td class="apiType">int</td><td><a href="#group___edi_1ga64cb0410a70843250c9826e8d12e3944" class="nameRef">ediAddValidation</a>(<a href="#group___edi" class="ref">Edi</a> *edi, <a href="osdep.html#group___osdep_1ga0f128c3e0c83721af0220c00554e9c4e" class="ref">cchar</a> *name, <a href="osdep.html#group___osdep_1ga0f128c3e0c83721af0220c00554e9c4e" class="ref">cchar</a> *tableName, <a href="osdep.html#group___osdep_1ga0f128c3e0c83721af0220c00554e9c4e" class="ref">cchar</a> *columnName, <a href="osdep.html#group___osdep_1ga5272042f7e0f5c53e2fd4b49ff47d92d" class="ref">cvoid</a> *data)</td></tr><tr class="apiBrief"><td>&nbsp;</td><td>Add a validation.</td></tr>
<tr class="apiDef"><td class="apiType">int</td><td><a href="#group___edi_1gaf35d7f7eba6e1ea718e0169987807f61" class="nameRef">ediChangeColumn</a>(<a href="#group___edi" class="ref">Edi</a> *edi, <a href="osdep.html#group___osdep_1ga0f128c3e0c83721af0220c00554e9c4e" class="ref">cchar</a> *tableName, <a href="osdep.html#group___osdep_1ga0f128c3e0c83721af0220c00554e9c4e" class="ref">cchar</a> *columnName, int type, int flags)</td></tr><tr class="apiBrief"><td>&nbsp;</td><td>Change a column schema definition.</td></tr>
<tr class="apiDef"><td class="apiType"><a href="#group___edi" class="ref">Edi</a> *</td><td><a href="#group___edi_1gab04c94ffae708160834f9ceb0588878d" class="nameRef">ediClone</a>(<a href="#group___edi" class="ref">Edi</a> *edi)</td></tr><tr class="apiBrief"><td>&nbsp;</td><td>Clone a database.</td></tr>
<tr class="apiDef"><td class="apiType"><a href="#group___edi_grid" class="ref">EdiGrid</a> *</td><td><a href="#group___edi_1gafcc1f1055e50028a02cb8acc0d1c1bd1" class="nameRef">ediCloneGrid</a>(<a href="#group___edi_grid" class="ref">EdiGrid</a> *grid)</td></tr><tr class="apiBrief"><td>&nbsp;</td><td>Clone a grid.</td></tr>
<tr class="apiDef"><td class="apiType">void</td><td><a href="#group___edi_1ga81b2c711a2a3047672b6c259946be394" class="nameRef">ediClose</a>(<a href="#group___edi" class="ref">Edi</a> *edi)</td></tr><tr class="apiBrief"><td>&nbsp;</td><td>Close a database.</td></tr>
<tr class="apiDef"><td class="apiType"><a href="#group___edi_grid" class="ref">EdiGrid</a> *</td><td><a href="#group___edi_1ga32592310371cdb3e6dff99ef4f02edfb" class="nameRef">ediCreateBareGrid</a>(<a href="#group___edi" class="ref">Edi</a> *edi, <a href="osdep.html#group___osdep_1ga0f128c3e0c83721af0220c00554e9c4e" class="ref">cchar</a> *tableName, int nrows)</td></tr><tr class="apiBrief"><td>&nbsp;</td><td>Create a bare grid.</td></tr>
<tr class="apiDef"><td class="apiType"><a href="#group___edi_rec" class="ref">EdiRec</a> *</td><td><a href="#group___edi_1gab2307e322966f7d74b2f43d375653c72" class="nameRef">ediCreateBareRec</a>(<a href="#group___edi" class="ref">Edi</a> *edi, <a href="osdep.html#group___osdep_1ga0f128c3e0c83721af0220c00554e9c4e" class="ref">cchar</a> *tableName, int nfields)</td></tr><tr class="apiBrief"><td>&nbsp;</td><td>Create a bare, free-standing record.</td></tr>
<tr class="apiDef"><td class="apiType"><a href="#group___edi_rec" class="ref">EdiRec</a> *</td><td><a href="#group___edi_1ga8b541b7e488761324513d98a940908ee" class="nameRef">ediCreateRec</a>(<a href="#group___edi" class="ref">Edi</a> *edi, <a href="osdep.html#group___osdep_1ga0f128c3e0c83721af0220c00554e9c4e" class="ref">cchar</a> *tableName)</td></tr><tr class="apiBrief"><td>&nbsp;</td><td>Create a new record based on the table&apos;s schema.</td></tr>
<tr class="apiDef"><td class="apiType"><a href="#group___edi_service" class="ref">EdiService</a> *</td><td><a href="#group___edi_service_1ga01745fce2b5ce0a096f69f9ca830eb55" class="nameRef">ediCreateService</a>(void)</td></tr><tr class="apiBrief"><td>&nbsp;</td><td>Create the EDI service.</td></tr>
<tr class="apiDef"><td class="apiType">void</td><td><a href="#group___edi_service_1ga789f616e9f38aee34d6862bf85ac4742" class="nameRef">ediDefineMigration</a>(struct Edi *edi, <a href="#edi_8h_1afef50d4216e0abc4595d23366fc7f328" class="ref">EdiMigration</a> forw, <a href="#edi_8h_1afef50d4216e0abc4595d23366fc7f328" class="ref">EdiMigration</a> back)</td></tr><tr class="apiBrief"><td>&nbsp;</td><td>Define database migration callbacks.</td></tr>
<tr class="apiDef"><td class="apiType">void</td><td><a href="#group___edi_service_1ga889df64bdd239f71c66b4fa920be8f46" class="nameRef">ediDefineValidation</a>(<a href="osdep.html#group___osdep_1ga0f128c3e0c83721af0220c00554e9c4e" class="ref">cchar</a> *name, <a href="#group___edi_service_1gad529099ab50bec8c2349eaa82c4a9e0d" class="ref">EdiValidationProc</a> vfn)</td></tr><tr class="apiBrief"><td>&nbsp;</td><td>Define a field validation procedure.</td></tr>
<tr class="apiDef"><td class="apiType">int</td><td><a href="#group___edi_1gaec3079929130e2f517f56d8c322e2468" class="nameRef">ediDelete</a>(<a href="#group___edi" class="ref">Edi</a> *edi, <a href="osdep.html#group___osdep_1ga0f128c3e0c83721af0220c00554e9c4e" class="ref">cchar</a> *path)</td></tr><tr class="apiBrief"><td>&nbsp;</td><td>Delete the database at the given path.</td></tr>
<tr class="apiDef"><td class="apiType">void</td><td><a href="#group___edi_1ga21a7e078206b019276d18123e24af1f7" class="nameRef">ediDumpGrid</a>(<a href="osdep.html#group___osdep_1ga0f128c3e0c83721af0220c00554e9c4e" class="ref">cchar</a> *message, <a href="#group___edi_grid" class="ref">EdiGrid</a> *grid)</td></tr><tr class="apiBrief"><td>&nbsp;</td><td>Display the grid to the debug log.</td></tr>
<tr class="apiDef"><td class="apiType">void</td><td><a href="#group___edi_1ga035889ee66fbb74bfdd9fd71ce4017ea" class="nameRef">ediDumpRec</a>(<a href="osdep.html#group___osdep_1ga0f128c3e0c83721af0220c00554e9c4e" class="ref">cchar</a> *message, <a href="#group___edi_rec" class="ref">EdiRec</a> *rec)</td></tr><tr class="apiBrief"><td>&nbsp;</td><td>Display a record to the debug log.</td></tr>
<tr class="apiDef"><td class="apiType"><a href="#group___edi_grid" class="ref">EdiGrid</a> *</td><td><a href="#group___edi_grid_1gafebe73ad2461122ba6e3aa93dfad5cc7" class="nameRef">ediFilterGridFields</a>(<a href="#group___edi_grid" class="ref">EdiGrid</a> *grid, <a href="osdep.html#group___osdep_1ga0f128c3e0c83721af0220c00554e9c4e" class="ref">cchar</a> *fields, int include)</td></tr><tr class="apiBrief"><td>&nbsp;</td><td>Filter the fields of a grid.</td></tr>
<tr class="apiDef"><td class="apiType"><a href="#group___edi_rec" class="ref">EdiRec</a> *</td><td><a href="#group___edi_rec_1ga481d6cbeb7c5f33ed0a5eb062ec1081a" class="nameRef">ediFilterRecFields</a>(<a href="#group___edi_rec" class="ref">EdiRec</a> *rec, <a href="osdep.html#group___osdep_1ga0f128c3e0c83721af0220c00554e9c4e" class="ref">cchar</a> *fields, int include)</td></tr><tr class="apiBrief"><td>&nbsp;</td><td>Filter the fields of a record.</td></tr>
<tr class="apiDef"><td class="apiType"><a href="#group___edi_grid" class="ref">EdiGrid</a> *</td><td><a href="#group___edi_1ga91b052815699c4c5868518e1fa8dbbc5" class="nameRef">ediFindGrid</a>(<a href="#group___edi" class="ref">Edi</a> *edi, <a href="osdep.html#group___osdep_1ga0f128c3e0c83721af0220c00554e9c4e" class="ref">cchar</a> *tableName, <a href="osdep.html#group___osdep_1ga0f128c3e0c83721af0220c00554e9c4e" class="ref">cchar</a> *query)</td></tr><tr class="apiBrief"><td>&nbsp;</td><td>Read matching records in a table.</td></tr>
<tr class="apiDef"><td class="apiType"><a href="#group___edi_rec" class="ref">EdiRec</a> *</td><td><a href="#group___edi_1gadb0ddb5aa0224df3b294f759d5a8fb65" class="nameRef">ediFindRec</a>(<a href="#group___edi" class="ref">Edi</a> *edi, <a href="osdep.html#group___osdep_1ga0f128c3e0c83721af0220c00554e9c4e" class="ref">cchar</a> *tableName, <a href="osdep.html#group___osdep_1ga0f128c3e0c83721af0220c00554e9c4e" class="ref">cchar</a> *query)</td></tr><tr class="apiBrief"><td>&nbsp;</td><td>Read one record.</td></tr>
<tr class="apiDef"><td class="apiType"><a href="osdep.html#group___osdep_1ga0f128c3e0c83721af0220c00554e9c4e" class="ref">cchar</a> *</td><td><a href="#group___edi_1ga5280a23047352db18eb64d243f5504f0" class="nameRef">ediFormatField</a>(<a href="osdep.html#group___osdep_1ga0f128c3e0c83721af0220c00554e9c4e" class="ref">cchar</a> *fmt, <a href="#group___edi_field" class="ref">EdiField</a> *fp)</td></tr><tr class="apiBrief"><td>&nbsp;</td><td>Format a field value.</td></tr>
<tr class="apiDef"><td class="apiType">int</td><td><a href="#group___edi_1gac764d3271d738b2e6d284e4d49e8b90e" class="nameRef">ediGetColumnSchema</a>(<a href="#group___edi" class="ref">Edi</a> *edi, <a href="osdep.html#group___osdep_1ga0f128c3e0c83721af0220c00554e9c4e" class="ref">cchar</a> *tableName, <a href="osdep.html#group___osdep_1ga0f128c3e0c83721af0220c00554e9c4e" class="ref">cchar</a> *columnName, int *type, int *flags, int *cid)</td></tr><tr class="apiBrief"><td>&nbsp;</td><td>Get the column schema.</td></tr>
<tr class="apiDef"><td class="apiType"><a href="mpr.html#group___mpr_list" class="ref">MprList</a> *</td><td><a href="#group___edi_1gaccb6af245d072ef1533dc7087237e798" class="nameRef">ediGetColumns</a>(<a href="#group___edi" class="ref">Edi</a> *edi, <a href="osdep.html#group___osdep_1ga0f128c3e0c83721af0220c00554e9c4e" class="ref">cchar</a> *tableName)</td></tr><tr class="apiBrief"><td>&nbsp;</td><td>Get a list of database column names.</td></tr>
<tr class="apiDef"><td class="apiType"><a href="#group___edi_field" class="ref">EdiField</a> *</td><td><a href="#group___edi_1ga6b96cf5d529ca63f393fe0e45eff50ff" class="nameRef">ediGetField</a>(<a href="#group___edi_rec" class="ref">EdiRec</a> *rec, <a href="osdep.html#group___osdep_1ga0f128c3e0c83721af0220c00554e9c4e" class="ref">cchar</a> *fieldName)</td></tr><tr class="apiBrief"><td>&nbsp;</td><td>Get a record field.</td></tr>
<tr class="apiDef"><td class="apiType">int</td><td><a href="#group___edi_1ga1f563dfa6f4ad87a227f0470b2a9838e" class="nameRef">ediGetFieldType</a>(<a href="#group___edi_rec" class="ref">EdiRec</a> *rec, <a href="osdep.html#group___osdep_1ga0f128c3e0c83721af0220c00554e9c4e" class="ref">cchar</a> *fieldName)</td></tr><tr class="apiBrief"><td>&nbsp;</td><td>Get the data type of a record field.</td></tr>
<tr class="apiDef"><td class="apiType"><a href="osdep.html#group___osdep_1ga0f128c3e0c83721af0220c00554e9c4e" class="ref">cchar</a> *</td><td><a href="#group___edi_1ga27d4c8e29d1bfd0669d739dc99b0e4ab" class="nameRef">ediGetFieldValue</a>(<a href="#group___edi_rec" class="ref">EdiRec</a> *rec, <a href="osdep.html#group___osdep_1ga0f128c3e0c83721af0220c00554e9c4e" class="ref">cchar</a> *fieldName)</td></tr><tr class="apiBrief"><td>&nbsp;</td><td>Get a field value.</td></tr>
<tr class="apiDef"><td class="apiType"><a href="mpr.html#group___mpr_list" class="ref">MprList</a> *</td><td><a href="#group___edi_1ga373646e27ebda56dcbdf80d94793526b" class="nameRef">ediGetGridColumns</a>(<a href="#group___edi_grid" class="ref">EdiGrid</a> *grid)</td></tr><tr class="apiBrief"><td>&nbsp;</td><td>Get a list of grid column names.</td></tr>
<tr class="apiDef"><td class="apiType"><a href="osdep.html#group___osdep_1ga0f128c3e0c83721af0220c00554e9c4e" class="ref">cchar</a> *</td><td><a href="#group___edi_grid_1ga7473de7608654d33297d63832da397d6" class="nameRef">ediGetGridSchemaAsJson</a>(<a href="#group___edi_grid" class="ref">EdiGrid</a> *grid)</td></tr><tr class="apiBrief"><td>&nbsp;</td><td>Get the schema for a grid and format as JSON.</td></tr>
<tr class="apiDef"><td class="apiType"><a href="#group___edi_field" class="ref">EdiField</a> *</td><td><a href="#group___edi_rec_1gacfca01f1e7f38e1e851c5f08a2305a06" class="nameRef">ediGetNextField</a>(<a href="#group___edi_rec" class="ref">EdiRec</a> *rec, <a href="#group___edi_field" class="ref">EdiField</a> *fp, int offset)</td></tr><tr class="apiBrief"><td>&nbsp;</td><td>Get the next field in a record This is used as an iterator.</td></tr>
<tr class="apiDef"><td class="apiType"><a href="#group___edi_rec" class="ref">EdiRec</a> *</td><td><a href="#group___edi_grid_1gac95c0f63bc7474b5dc6dbc75a300d7bd" class="nameRef">ediGetNextRec</a>(<a href="#group___edi_grid" class="ref">EdiGrid</a> *grid, <a href="#group___edi_rec" class="ref">EdiRec</a> *rec)</td></tr><tr class="apiBrief"><td>&nbsp;</td><td>Get the next record in a grid This is used as an iterator.</td></tr>
<tr class="apiDef"><td class="apiType"><a href="mpr.html#struct_mpr_hash" class="ref">MprHash</a> *</td><td><a href="#group___edi_1ga7515e433e2812cae0d0a68cf3af899dd" class="nameRef">ediGetRecErrors</a>(<a href="#group___edi_rec" class="ref">EdiRec</a> *rec)</td></tr><tr class="apiBrief"><td>&nbsp;</td><td>Get record validation errors.</td></tr>
<tr class="apiDef"><td class="apiType"><a href="osdep.html#group___osdep_1ga0f128c3e0c83721af0220c00554e9c4e" class="ref">cchar</a> *</td><td><a href="#group___edi_rec_1ga077db7249be1c42310b5a77df426f3d6" class="nameRef">ediGetRecSchemaAsJson</a>(<a href="#group___edi_rec" class="ref">EdiRec</a> *rec)</td></tr><tr class="apiBrief"><td>&nbsp;</td><td>Get the schema for a record and format as JSON.</td></tr>
<tr class="apiDef"><td class="apiType">int</td><td><a href="#group___edi_1ga159e08f49d49361fd64b40e5df18b644" class="nameRef">ediGetTableDimensions</a>(<a href="#group___edi" class="ref">Edi</a> *edi, <a href="osdep.html#group___osdep_1ga0f128c3e0c83721af0220c00554e9c4e" class="ref">cchar</a> *tableName, int *numRows, int *numCols)</td></tr><tr class="apiBrief"><td>&nbsp;</td><td>Get table dimensions information.</td></tr>
<tr class="apiDef"><td class="apiType"><a href="osdep.html#group___osdep_1ga0f128c3e0c83721af0220c00554e9c4e" class="ref">cchar</a> *</td><td><a href="#group___edi_1ga77ea7a7a45357a2f24d48a37cdaf63b9" class="nameRef">ediGetTableSchemaAsJson</a>(<a href="#group___edi" class="ref">Edi</a> *edi, <a href="osdep.html#group___osdep_1ga0f128c3e0c83721af0220c00554e9c4e" class="ref">cchar</a> *tableName)</td></tr><tr class="apiBrief"><td>&nbsp;</td><td>Get a table schema and format as JSON.</td></tr>
<tr class="apiDef"><td class="apiType"><a href="mpr.html#group___mpr_list" class="ref">MprList</a> *</td><td><a href="#group___edi_1ga3966b26c7dac47dfd90ab49d2db947a2" class="nameRef">ediGetTables</a>(<a href="#group___edi" class="ref">Edi</a> *edi)</td></tr><tr class="apiBrief"><td>&nbsp;</td><td>Get a list of database tables.</td></tr>
<tr class="apiDef"><td class="apiType">char *</td><td><a href="#group___edi_1ga33a7a71fba3899caa169401f5ff7e2c0" class="nameRef">ediGetTypeString</a>(int type)</td></tr><tr class="apiBrief"><td>&nbsp;</td><td>Convert an EDI type to a string.</td></tr>
<tr class="apiDef"><td class="apiType"><a href="osdep.html#group___osdep_1ga0f128c3e0c83721af0220c00554e9c4e" class="ref">cchar</a> *</td><td><a href="#group___edi_1gaf09a23b35d227fc250db135d866355bb" class="nameRef">ediGridAsJson</a>(<a href="#group___edi_grid" class="ref">EdiGrid</a> *grid, int flags)</td></tr><tr class="apiBrief"><td>&nbsp;</td><td>Convert an EDI database grid into a JSON string.</td></tr>
<tr class="apiDef"><td class="apiType"><a href="#group___edi_grid" class="ref">EdiGrid</a> *</td><td><a href="#group___edi_1ga7a98c7d38eb38d0cb063e532ad00b3af" class="nameRef">ediJoin</a>(<a href="#group___edi" class="ref">Edi</a> *edi, ...)</td></tr><tr class="apiBrief"><td>&nbsp;</td><td>Join grids.</td></tr>
<tr class="apiDef"><td class="apiType">int</td><td><a href="#group___edi_1ga7dec1de01e90319b1ff0fe351f83f49e" class="nameRef">ediLoad</a>(<a href="#group___edi" class="ref">Edi</a> *edi, <a href="osdep.html#group___osdep_1ga0f128c3e0c83721af0220c00554e9c4e" class="ref">cchar</a> *path)</td></tr><tr class="apiBrief"><td>&nbsp;</td><td>Load the database file.</td></tr>
<tr class="apiDef"><td class="apiType">int</td><td><a href="#group___edi_1gaa88adbb2470a05da45d468fd9d578672" class="nameRef">ediLookupField</a>(<a href="#group___edi" class="ref">Edi</a> *edi, <a href="osdep.html#group___osdep_1ga0f128c3e0c83721af0220c00554e9c4e" class="ref">cchar</a> *tableName, <a href="osdep.html#group___osdep_1ga0f128c3e0c83721af0220c00554e9c4e" class="ref">cchar</a> *fieldName)</td></tr><tr class="apiBrief"><td>&nbsp;</td><td>Lookup a column field by name.</td></tr>
<tr class="apiDef"><td class="apiType"><a href="#struct_edi_provider" class="ref">EdiProvider</a> *</td><td><a href="#group___edi_1gacd2aff777ea4c70bde7b9b6c9b0de094" class="nameRef">ediLookupProvider</a>(<a href="osdep.html#group___osdep_1ga0f128c3e0c83721af0220c00554e9c4e" class="ref">cchar</a> *providerName)</td></tr><tr class="apiBrief"><td>&nbsp;</td><td>Lookup an EDI provider name.</td></tr>
<tr class="apiDef"><td class="apiType"><a href="#group___edi_grid" class="ref">EdiGrid</a> *</td><td><a href="#group___edi_1gacd00541258b1416933db860571939008" class="nameRef">ediMakeGrid</a>(<a href="osdep.html#group___osdep_1ga0f128c3e0c83721af0220c00554e9c4e" class="ref">cchar</a> *content)</td></tr>
<tr class="apiDef"><td class="apiType"><a href="mpr.html#group___mpr_json" class="ref">MprJson</a> *</td><td><a href="#group___edi_1gaea9ea34697e6bf20f37346b46db7c655" class="nameRef">ediMakeJson</a>(<a href="osdep.html#group___osdep_1ga0f128c3e0c83721af0220c00554e9c4e" class="ref">cchar</a> *fmt, ...)</td></tr><tr class="apiBrief"><td>&nbsp;</td><td>Make a JSON container of property values.</td></tr>
<tr class="apiDef"><td class="apiType"><a href="#group___edi_rec" class="ref">EdiRec</a> *</td><td><a href="#group___edi_1ga1922ba347b5805fc71d6b6a781d62227" class="nameRef">ediMakeRec</a>(<a href="osdep.html#group___osdep_1ga0f128c3e0c83721af0220c00554e9c4e" class="ref">cchar</a> *content)</td></tr><tr class="apiBrief"><td>&nbsp;</td><td>Make a record.</td></tr>
<tr class="apiDef"><td class="apiType"><a href="#group___edi_rec" class="ref">EdiRec</a> *</td><td><a href="#group___edi_1ga70d7dc2a0603130510a147c4aafcf245" class="nameRef">ediMakeRecFromJson</a>(<a href="osdep.html#group___osdep_1ga0f128c3e0c83721af0220c00554e9c4e" class="ref">cchar</a> *tableName, <a href="mpr.html#group___mpr_json" class="ref">MprJson</a> *fields)</td></tr><tr class="apiBrief"><td>&nbsp;</td><td>Make a record from a JSON fields object.</td></tr>
<tr class="apiDef"><td class="apiType">void</td><td><a href="#group___edi_1ga6913a7aa47c80857de9057e5442b5834" class="nameRef">ediManageEdiRec</a>(<a href="#group___edi_rec" class="ref">EdiRec</a> *rec, int flags)</td></tr><tr class="apiBrief"><td>&nbsp;</td><td>Manage an EdiRec instance for garbage collection.</td></tr>
<tr class="apiDef"><td class="apiType"><a href="#group___edi" class="ref">Edi</a> *</td><td><a href="#group___edi_1ga4097dbe07be0c7277ca7b4804ebe8b6d" class="nameRef">ediOpen</a>(<a href="osdep.html#group___osdep_1ga0f128c3e0c83721af0220c00554e9c4e" class="ref">cchar</a> *source, <a href="osdep.html#group___osdep_1ga0f128c3e0c83721af0220c00554e9c4e" class="ref">cchar</a> *provider, int flags)</td></tr><tr class="apiBrief"><td>&nbsp;</td><td>Open a database.</td></tr>
<tr class="apiDef"><td class="apiType">int</td><td><a href="#group___edi_1ga9e890e5216c6c01220e6ba150197a0e1" class="nameRef">ediParseTypeString</a>(<a href="osdep.html#group___osdep_1ga0f128c3e0c83721af0220c00554e9c4e" class="ref">cchar</a> *type)</td></tr><tr class="apiBrief"><td>&nbsp;</td><td>Parse an EDI type string.</td></tr>
<tr class="apiDef"><td class="apiType"><a href="#group___edi_grid" class="ref">EdiGrid</a> *</td><td><a href="#group___edi_grid_1gae6678ab4640819b370e791819d165652" class="nameRef">ediPivotGrid</a>(<a href="#group___edi_grid" class="ref">EdiGrid</a> *grid, int flags)</td></tr><tr class="apiBrief"><td>&nbsp;</td><td>Pivot a grid swapping rows for columns.</td></tr>
<tr class="apiDef"><td class="apiType"><a href="#group___edi_grid" class="ref">EdiGrid</a> *</td><td><a href="#group___edi_1ga7566ab902570254700047faaa83376b5" class="nameRef">ediQuery</a>(<a href="#group___edi" class="ref">Edi</a> *edi, <a href="osdep.html#group___osdep_1ga0f128c3e0c83721af0220c00554e9c4e" class="ref">cchar</a> *cmd, int argc, <a href="osdep.html#group___osdep_1ga0f128c3e0c83721af0220c00554e9c4e" class="ref">cchar</a> **argv, va_list vargs)</td></tr><tr class="apiBrief"><td>&nbsp;</td><td>Run a database query query.</td></tr>
<tr class="apiDef"><td class="apiType"><a href="#group___edi_field" class="ref">EdiField</a></td><td><a href="#group___edi_1gafe7cfc471e3df12dcd88b28ff01a958d" class="nameRef">ediReadField</a>(<a href="#group___edi" class="ref">Edi</a> *edi, <a href="osdep.html#group___osdep_1ga0f128c3e0c83721af0220c00554e9c4e" class="ref">cchar</a> *tableName, <a href="osdep.html#group___osdep_1ga0f128c3e0c83721af0220c00554e9c4e" class="ref">cchar</a> *key, <a href="osdep.html#group___osdep_1ga0f128c3e0c83721af0220c00554e9c4e" class="ref">cchar</a> *fieldName)</td></tr><tr class="apiBrief"><td>&nbsp;</td><td>Read a field from the database.</td></tr>
<tr class="apiDef"><td class="apiType"><a href="osdep.html#group___osdep_1ga0f128c3e0c83721af0220c00554e9c4e" class="ref">cchar</a> *</td><td><a href="#group___edi_1ga3b77af448ef24198f3ac8984ac42f40d" class="nameRef">ediReadFieldValue</a>(<a href="#group___edi" class="ref">Edi</a> *edi, <a href="osdep.html#group___osdep_1ga0f128c3e0c83721af0220c00554e9c4e" class="ref">cchar</a> *fmt, <a href="osdep.html#group___osdep_1ga0f128c3e0c83721af0220c00554e9c4e" class="ref">cchar</a> *tableName, <a href="osdep.html#group___osdep_1ga0f128c3e0c83721af0220c00554e9c4e" class="ref">cchar</a> *key, <a href="osdep.html#group___osdep_1ga0f128c3e0c83721af0220c00554e9c4e" class="ref">cchar</a> *fieldName, <a href="osdep.html#group___osdep_1ga0f128c3e0c83721af0220c00554e9c4e" class="ref">cchar</a> *defaultValue)</td></tr><tr class="apiBrief"><td>&nbsp;</td><td>Read a formatted field from the database.</td></tr>
<tr class="apiDef"><td class="apiType"><a href="#group___edi_rec" class="ref">EdiRec</a> *</td><td><a href="#group___edi_1ga3e328361501597c363a8be095148d7f6" class="nameRef">ediReadRec</a>(<a href="#group___edi" class="ref">Edi</a> *edi, <a href="osdep.html#group___osdep_1ga0f128c3e0c83721af0220c00554e9c4e" class="ref">cchar</a> *tableName, <a href="osdep.html#group___osdep_1ga0f128c3e0c83721af0220c00554e9c4e" class="ref">cchar</a> *key)</td></tr><tr class="apiBrief"><td>&nbsp;</td><td>Read a record.</td></tr>
<tr class="apiDef"><td class="apiType"><a href="osdep.html#group___osdep_1ga0f128c3e0c83721af0220c00554e9c4e" class="ref">cchar</a> *</td><td><a href="#group___edi_1ga3329949bda2281f8b85f103f0108ccc1" class="nameRef">ediRecAsJson</a>(<a href="#group___edi_rec" class="ref">EdiRec</a> *rec, int flags)</td></tr><tr class="apiBrief"><td>&nbsp;</td><td>Convert an EDI database record into a JSON string.</td></tr>
<tr class="apiDef"><td class="apiType">int</td><td><a href="#group___edi_1ga2e0e7c2d3e5c286a51bdc7c1d18cc34b" class="nameRef">ediRemoveIndex</a>(<a href="#group___edi" class="ref">Edi</a> *edi, <a href="osdep.html#group___osdep_1ga0f128c3e0c83721af0220c00554e9c4e" class="ref">cchar</a> *tableName, <a href="osdep.html#group___osdep_1ga0f128c3e0c83721af0220c00554e9c4e" class="ref">cchar</a> *indexName)</td></tr><tr class="apiBrief"><td>&nbsp;</td><td>Remove a table index.</td></tr>
<tr class="apiDef"><td class="apiType">int</td><td><a href="#group___edi_1gaaa5333b9b756b1d362d9803830ec3f50" class="nameRef">ediRemoveRec</a>(<a href="#group___edi" class="ref">Edi</a> *edi, <a href="osdep.html#group___osdep_1ga0f128c3e0c83721af0220c00554e9c4e" class="ref">cchar</a> *tableName, <a href="osdep.html#group___osdep_1ga0f128c3e0c83721af0220c00554e9c4e" class="ref">cchar</a> *key)</td></tr><tr class="apiBrief"><td>&nbsp;</td><td>Delete a row in a database table identified by a key value.</td></tr>
<tr class="apiDef"><td class="apiType">int</td><td><a href="#group___edi_1gae965f0739fa618a75fdc0455453dec14" class="nameRef">ediRemoveTable</a>(<a href="#group___edi" class="ref">Edi</a> *edi, <a href="osdep.html#group___osdep_1ga0f128c3e0c83721af0220c00554e9c4e" class="ref">cchar</a> *tableName)</td></tr><tr class="apiBrief"><td>&nbsp;</td><td>Remove a table from the database.</td></tr>
<tr class="apiDef"><td class="apiType">int</td><td><a href="#group___edi_1ga6725ef26c5e502c45ed03f42c2f75051" class="nameRef">ediRenameColumn</a>(<a href="#group___edi" class="ref">Edi</a> *edi, <a href="osdep.html#group___osdep_1ga0f128c3e0c83721af0220c00554e9c4e" class="ref">cchar</a> *tableName, <a href="osdep.html#group___osdep_1ga0f128c3e0c83721af0220c00554e9c4e" class="ref">cchar</a> *columnName, <a href="osdep.html#group___osdep_1ga0f128c3e0c83721af0220c00554e9c4e" class="ref">cchar</a> *newColumnName)</td></tr><tr class="apiBrief"><td>&nbsp;</td><td>Rename a column.</td></tr>
<tr class="apiDef"><td class="apiType">int</td><td><a href="#group___edi_1ga42ebae84b96f934005926c25cb568f24" class="nameRef">ediRenameTable</a>(<a href="#group___edi" class="ref">Edi</a> *edi, <a href="osdep.html#group___osdep_1ga0f128c3e0c83721af0220c00554e9c4e" class="ref">cchar</a> *tableName, <a href="osdep.html#group___osdep_1ga0f128c3e0c83721af0220c00554e9c4e" class="ref">cchar</a> *newTableName)</td></tr><tr class="apiBrief"><td>&nbsp;</td><td>Rename a table.</td></tr>
<tr class="apiDef"><td class="apiType">int</td><td><a href="#group___edi_1ga77d616667577833662154d65ef794519" class="nameRef">ediSave</a>(<a href="#group___edi" class="ref">Edi</a> *edi)</td></tr><tr class="apiBrief"><td>&nbsp;</td><td>Save in-memory database contents to disk.</td></tr>
<tr class="apiDef"><td class="apiType"><a href="#group___edi_rec" class="ref">EdiRec</a> *</td><td><a href="#group___edi_1gaf4e56d097ffeb991cb11b2b6c102539e" class="nameRef">ediSetField</a>(<a href="#group___edi_rec" class="ref">EdiRec</a> *rec, <a href="osdep.html#group___osdep_1ga0f128c3e0c83721af0220c00554e9c4e" class="ref">cchar</a> *fieldName, <a href="osdep.html#group___osdep_1ga0f128c3e0c83721af0220c00554e9c4e" class="ref">cchar</a> *value)</td></tr><tr class="apiBrief"><td>&nbsp;</td><td>Set a record field without writing to the database.</td></tr>
<tr class="apiDef"><td class="apiType"><a href="#group___edi_rec" class="ref">EdiRec</a> *</td><td><a href="#group___edi_1ga1d7f0272d91019359cb1b3627d16883d" class="nameRef">ediSetFieldFmt</a>(<a href="#group___edi_rec" class="ref">EdiRec</a> *rec, <a href="osdep.html#group___osdep_1ga0f128c3e0c83721af0220c00554e9c4e" class="ref">cchar</a> *fieldName, <a href="osdep.html#group___osdep_1ga0f128c3e0c83721af0220c00554e9c4e" class="ref">cchar</a> *fmt, ...)</td></tr><tr class="apiBrief"><td>&nbsp;</td><td>Set a record field using a format string.</td></tr>
<tr class="apiDef"><td class="apiType"><a href="#group___edi_rec" class="ref">EdiRec</a> *</td><td><a href="#group___edi_1gaa46e5558798c50a66434aadd3d7628e5" class="nameRef">ediSetFields</a>(<a href="#group___edi_rec" class="ref">EdiRec</a> *rec, <a href="mpr.html#group___mpr_json" class="ref">MprJson</a> *data)</td></tr><tr class="apiBrief"><td>&nbsp;</td><td>Set record fields without writing to the database.</td></tr>
<tr class="apiDef"><td class="apiType">void</td><td><a href="#group___edi_1ga8a81197882a1574b7bd5a89dd725d238" class="nameRef">ediSetPrivate</a>(<a href="#group___edi" class="ref">Edi</a> *edi, <a href="osdep.html#group___osdep_1gad5c9d4ba3dc37783a528b0925dc981a0" class="ref">bool</a> on)</td></tr><tr class="apiBrief"><td>&nbsp;</td><td>Create a private database for each client.</td></tr>
<tr class="apiDef"><td class="apiType">void</td><td><a href="#group___edi_1ga04c6635bccb8f8c2a1b2d5e3bad74bd3" class="nameRef">ediSetReadonly</a>(<a href="#group___edi" class="ref">Edi</a> *edi, <a href="osdep.html#group___osdep_1gad5c9d4ba3dc37783a528b0925dc981a0" class="ref">bool</a> on)</td></tr><tr class="apiBrief"><td>&nbsp;</td><td>Control whether the database accepts updates.</td></tr>
<tr class="apiDef"><td class="apiType">int</td><td><a href="#group___edi_1ga14dfc03675a9312facb1be7dd48f73d6" class="nameRef">ediUpdateField</a>(<a href="#group___edi" class="ref">Edi</a> *edi, <a href="osdep.html#group___osdep_1ga0f128c3e0c83721af0220c00554e9c4e" class="ref">cchar</a> *tableName, <a href="osdep.html#group___osdep_1ga0f128c3e0c83721af0220c00554e9c4e" class="ref">cchar</a> *key, <a href="osdep.html#group___osdep_1ga0f128c3e0c83721af0220c00554e9c4e" class="ref">cchar</a> *fieldName, <a href="osdep.html#group___osdep_1ga0f128c3e0c83721af0220c00554e9c4e" class="ref">cchar</a> *value)</td></tr><tr class="apiBrief"><td>&nbsp;</td><td>Write a value to a database table field.</td></tr>
<tr class="apiDef"><td class="apiType">int</td><td><a href="#group___edi_1gaa871db11b6b3ea1a177769a09078f732" class="nameRef">ediUpdateFieldFmt</a>(<a href="#group___edi" class="ref">Edi</a> *edi, <a href="osdep.html#group___osdep_1ga0f128c3e0c83721af0220c00554e9c4e" class="ref">cchar</a> *tableName, <a href="osdep.html#group___osdep_1ga0f128c3e0c83721af0220c00554e9c4e" class="ref">cchar</a> *key, <a href="osdep.html#group___osdep_1ga0f128c3e0c83721af0220c00554e9c4e" class="ref">cchar</a> *fieldName, <a href="osdep.html#group___osdep_1ga0f128c3e0c83721af0220c00554e9c4e" class="ref">cchar</a> *fmt, ...)</td></tr><tr class="apiBrief"><td>&nbsp;</td><td>Write a formatted value to a database table field.</td></tr>
<tr class="apiDef"><td class="apiType">int</td><td><a href="#group___edi_1ga9b65a775c4ddc081e49b1a55cabc06aa" class="nameRef">ediUpdateRec</a>(<a href="#group___edi" class="ref">Edi</a> *edi, <a href="#group___edi_rec" class="ref">EdiRec</a> *rec)</td></tr><tr class="apiBrief"><td>&nbsp;</td><td>Write a record to the database.</td></tr>
<tr class="apiDef"><td class="apiType"><a href="osdep.html#group___osdep_1gad5c9d4ba3dc37783a528b0925dc981a0" class="ref">bool</a></td><td><a href="#group___edi_1ga7525ab6e695b51abc1bb342b8f35022b" class="nameRef">ediValidateRec</a>(<a href="#group___edi_rec" class="ref">EdiRec</a> *rec)</td></tr><tr class="apiBrief"><td>&nbsp;</td><td>Validate a record.</td></tr>
</table>
<a name="Typedefs"></a><h2>Typedefs</h2>
<table class="apiIndex" title="typedefs">
<tr class="apiDef"><td class="apiName"><a href="#struct_edi_provider" class="nameRef">EdiProvider</a></td><td class="apiBrief">Database provider interface.</td></tr>
<tr class="apiDef"><td class="apiName"><a href="#struct_edi_validation" class="nameRef">EdiValidation</a></td><td class="apiBrief">Validation structure.</td></tr>
<tr class="apiDef"><td class="apiName"><a href="#group___edi_service_1gad529099ab50bec8c2349eaa82c4a9e0d" class="nameRef">EdiValidationProc</a></td><td class="apiBrief">Field validation callback procedure.</td></tr>
</table>
<a name="Defines"></a><h2>Defines</h2>
<table class="apiIndex" title="Defines">
<tr class="apiDef">
<td>#define</td><td><a href="#edi_8h_1a84cefff441de0de7ef30a78e55150c1a" class="nameRef">EDI_AUTO_INC</a>&nbsp;&nbsp;&nbsp;0x1</td>
</tr>
<tr class="apiBrief"><td>&nbsp;</td><td>Field flag <ndash/> Automatic increments on new row.</td></tr>
<tr class="apiDef">
<td>#define</td><td><a href="#edi_8h_1a0fc3c13863bc64f832d0524825eaccec" class="nameRef">EDI_AUTO_SAVE</a>&nbsp;&nbsp;&nbsp;0x2</td>
</tr>
<tr class="apiBrief"><td>&nbsp;</td><td>Auto-save database if modified in memory.</td></tr>
<tr class="apiDef">
<td>#define</td><td><a href="#edi_8h_1a12ef9df56bd504e09c8466345a3f8f2c" class="nameRef">EDI_CREATE</a>&nbsp;&nbsp;&nbsp;0x1</td>
</tr>
<tr class="apiBrief"><td>&nbsp;</td><td>Create database if not present.</td></tr>
<tr class="apiDef">
<td>#define</td><td><a href="#edi_8h_1a26eb47bd03dbe38d487bfbe714eb8f45" class="nameRef">EDI_FOREIGN</a>&nbsp;&nbsp;&nbsp;0x8</td>
</tr>
<tr class="apiBrief"><td>&nbsp;</td><td>Field flag <ndash/> Column is a foreign key.</td></tr>
<tr class="apiDef">
<td>#define</td><td><a href="#edi_8h_1af4b1c5417043e83de7e12253173c4b32" class="nameRef">EDI_GRID_READ_ONLY</a>&nbsp;&nbsp;&nbsp;0x1</td>
</tr>
<tr class="apiBrief"><td>&nbsp;</td><td>Grid contains pure database records, must not be modified.</td></tr>
<tr class="apiDef">
<td>#define</td><td><a href="#edi_8h_1aa250b5270a6712a110ad52fb6de2e943" class="nameRef">EDI_INDEX</a>&nbsp;&nbsp;&nbsp;0x4</td>
</tr>
<tr class="apiBrief"><td>&nbsp;</td><td>Field flag <ndash/> Column is indexed.</td></tr>
<tr class="apiDef">
<td>#define</td><td><a href="#edi_8h_1a14387cca6628803c8ef36dde843d6859" class="nameRef">EDI_KEY</a>&nbsp;&nbsp;&nbsp;0x2</td>
</tr>
<tr class="apiBrief"><td>&nbsp;</td><td>Field flag <ndash/> Column is the ID key.</td></tr>
<tr class="apiDef">
<td>#define</td><td><a href="#edi_8h_1a39aeab0f683f28577c0069b7fde2425a" class="nameRef">EDI_LITERAL</a>&nbsp;&nbsp;&nbsp;0x8</td>
</tr>
<tr class="apiBrief"><td>&nbsp;</td><td>Literal schema in ediOpen source parameter.</td></tr>
<tr class="apiDef">
<td>#define</td><td><a href="#edi_8h_1a83428eb53ed4c3e10521b459df263308" class="nameRef">EDI_NO_SAVE</a>&nbsp;&nbsp;&nbsp;0x4</td>
</tr>
<tr class="apiBrief"><td>&nbsp;</td><td>Prevent saving to disk.</td></tr>
<tr class="apiDef">
<td>#define</td><td><a href="#edi_8h_1af1eaf78875be29a2bf00cf732dec04ea" class="nameRef">EDI_NOT_NULL</a>&nbsp;&nbsp;&nbsp;0x10</td>
</tr>
<tr class="apiBrief"><td>&nbsp;</td><td>Field flag <ndash/> Column must not be null (not implemented).</td></tr>
<tr class="apiDef">
<td>#define</td><td><a href="#edi_8h_1a8e7cad2b406b0d2b1306fcf646703faa" class="nameRef">EDI_PRIVATE</a>&nbsp;&nbsp;&nbsp;0x20</td>
</tr>
<tr class="apiBrief"><td>&nbsp;</td><td>Create private clone of the database.</td></tr>
<tr class="apiDef">
<td>#define</td><td><a href="#edi_8h_1ad8bce44fd493d0ff9e43ec5bb7f41c50" class="nameRef">EDI_READ_ONLY</a>&nbsp;&nbsp;&nbsp;0x20</td>
</tr>
<tr class="apiBrief"><td>&nbsp;</td><td>Field flag <ndash/> Field is read-only (not implemented).</td></tr>
<tr class="apiDef">
<td>#define</td><td><a href="#edi_8h_1a288a24bd0787d029ff45d5ff524be9d5" class="nameRef">EDI_SUPPRESS_SAVE</a>&nbsp;&nbsp;&nbsp;0x10</td>
</tr>
<tr class="apiBrief"><td>&nbsp;</td><td>Temporarily suppress auto-save.</td></tr>
<tr class="apiDef">
<td>#define</td><td><a href="#edi_8h_1a746df6a6802b08fe4947b35244dba71c" class="nameRef">EDI_TYPE_BINARY</a>&nbsp;&nbsp;&nbsp;1</td>
</tr>
<tr class="apiBrief"><td>&nbsp;</td><td>Arbitrary binary data.</td></tr>
<tr class="apiDef">
<td>#define</td><td><a href="#edi_8h_1a77bdc2d051ab90c28efe5e4ba1cceb2c" class="nameRef">EDI_TYPE_BOOL</a>&nbsp;&nbsp;&nbsp;2</td>
</tr>
<tr class="apiBrief"><td>&nbsp;</td><td>Boolean true|false value.</td></tr>
<tr class="apiDef">
<td>#define</td><td><a href="#edi_8h_1a7fc2ab5751a3baca9319cfd53875f9d6" class="nameRef">EDI_TYPE_DATE</a>&nbsp;&nbsp;&nbsp;3</td>
</tr>
<tr class="apiBrief"><td>&nbsp;</td><td>Date type (stored as epoch).</td></tr>
<tr class="apiDef">
<td>#define</td><td><a href="#edi_8h_1a2870a18f02348419a26169dbf0ebf409" class="nameRef">EDI_TYPE_FLOAT</a>&nbsp;&nbsp;&nbsp;4</td>
</tr>
<tr class="apiBrief"><td>&nbsp;</td><td>Floating point number.</td></tr>
<tr class="apiDef">
<td>#define</td><td><a href="#edi_8h_1a2d1f6f789e2bf18e8ea956932b2dbff0" class="nameRef">EDI_TYPE_INT</a>&nbsp;&nbsp;&nbsp;5</td>
</tr>
<tr class="apiBrief"><td>&nbsp;</td><td>Integer number.</td></tr>
<tr class="apiDef">
<td>#define</td><td><a href="#edi_8h_1a68172d98d38832146258813c3db750d1" class="nameRef">EDI_TYPE_MAX</a>&nbsp;&nbsp;&nbsp;8</td>
</tr>
<tr class="apiBrief"><td>&nbsp;</td><td>Max type + 1.</td></tr>
<tr class="apiDef">
<td>#define</td><td><a href="#edi_8h_1adaf7fc17c98589a64fd985cebcef3f00" class="nameRef">EDI_TYPE_STRING</a>&nbsp;&nbsp;&nbsp;6</td>
</tr>
<tr class="apiBrief"><td>&nbsp;</td><td>String.</td></tr>
<tr class="apiDef">
<td>#define</td><td><a href="#edi_8h_1a472cde49406f5a25cd201576622a4781" class="nameRef">EDI_TYPE_TEXT</a>&nbsp;&nbsp;&nbsp;7</td>
</tr>
<tr class="apiBrief"><td>&nbsp;</td><td>Multi-line text.</td></tr>
  </table>
<h2>Edi</h2>
<a name="group___edi"></a>
<div class="api">
  <div class="prototype">Edi</div>
  <div class="apiDetail">
<p>Database structure.</p>
    <dl><dt><b>Description</b>:</dt><dd>The Embedded Database Interface (EDI) defines an abstract interface atop various relational database providers. Providers are supplied for SQLite and for the ESP Memory Database (MDB).</dd></dl>
    <dl><dt>Fields:</dt><dd>
    <table class="parameters" title="Parameters">
    <tr><td class="param">EdiMigration</td><td><td>back</td><td>
Backward migration callback.
</td>
    <tr><td class="param">char *</td><td><td>errMsg</td><td>
Last error message.
</td>
    <tr><td class="param">int</td><td><td>flags</td><td>
Database flags.
</td>
    <tr><td class="param">EdiMigration</td><td><td>forw</td><td>
Forward migration callback.
</td>
    <tr><td class="param"><a class="ref" href="#struct_mpr_mutex" external="/Users/mob/dev/mpr/doc/api/mpr.dtags">MprMutex</a> *</td><td><td>mutex</td><td>
Multithread lock.
</td>
    <tr><td class="param">cchar *</td><td><td>path</td><td>
Database path.
</td>
    <tr><td class="param">struct <a class="ref" href="#struct_edi_provider">EdiProvider</a> *</td><td><td>provider</td><td>
Database provider.
</td>
    <tr><td class="param"><a class="ref" href="#struct_mpr_hash" external="/Users/mob/dev/mpr/doc/api/mpr.dtags">MprHash</a> *</td><td><td>schemaCache</td><td>
Cache of table schema in JSON.
</td>
    <tr><td class="param"><a class="ref" href="#struct_mpr_hash" external="/Users/mob/dev/mpr/doc/api/mpr.dtags">MprHash</a> *</td><td><td>validations</td><td>
Validations.
</td>
    </table></dd></dl>
  </div>
</div>
<a name="group___edi_1gab66595c455e15000e812ec830acce7d9"></a>
<div class="api">
  <div class="prototype">
    int
    ediAddColumn
(<a href="#group___edi" class="ref">Edi</a> *edi, <a href="osdep.html#group___osdep_1ga0f128c3e0c83721af0220c00554e9c4e" class="ref">cchar</a> *tableName, <a href="osdep.html#group___osdep_1ga0f128c3e0c83721af0220c00554e9c4e" class="ref">cchar</a> *columnName, int type, int flags)
  </div>
  <div class="apiDetail">
<p>Add a column to a table.</p>
    <dl><dt>Parameters:</dt><dd>
    <table class="parameters" title="Parameters">
    <tr><td class="param">edi</td><td>Database handle.</td>
    <tr><td class="param">tableName</td><td>Database table name.</td>
    <tr><td class="param">columnName</td><td>Database column name.</td>
    <tr><td class="param">type</td><td>Column data type. Set to one of EDI_TYPE_BINARY, EDI_TYPE_BOOL, EDI_TYPE_DATE EDI_TYPE_FLOAT, EDI_TYPE_INT, EDI_TYPE_STRING, EDI_TYPE_TEXT.</td>
    <tr><td class="param">flags</td><td>Control column attributes. Set to a set of: EDI_AUTO_INC for auto incrementing columns, EDI_KEY if the column is the key column and/or EDI_INDEX to create an index on the column.</td>
    </table></dd></dl>
    <dl><dt>Returns:</dt><dd>Zero if successful. Otherwise a negative MPR error code.</dd></dl>
    <dl><dt><b>API</b> Stability:</dt><dd>Stable.</dd></dl>
  </div>
</div>
<a name="group___edi_1gaa6413f84f22899c4ae15e8ac3f477f56"></a>
<div class="api">
  <div class="prototype">
    int
    ediAddIndex
(<a href="#group___edi" class="ref">Edi</a> *edi, <a href="osdep.html#group___osdep_1ga0f128c3e0c83721af0220c00554e9c4e" class="ref">cchar</a> *tableName, <a href="osdep.html#group___osdep_1ga0f128c3e0c83721af0220c00554e9c4e" class="ref">cchar</a> *columnName, <a href="osdep.html#group___osdep_1ga0f128c3e0c83721af0220c00554e9c4e" class="ref">cchar</a> *indexName)
  </div>
  <div class="apiDetail">
<p>Add an index to a table.</p>
    <dl><dt>Parameters:</dt><dd>
    <table class="parameters" title="Parameters">
    <tr><td class="param">edi</td><td>Database handle.</td>
    <tr><td class="param">tableName</td><td>Database table name.</td>
    <tr><td class="param">columnName</td><td>Database column name.</td>
    <tr><td class="param">indexName</td><td>Ignored. Set to null.</td>
    </table></dd></dl>
    <dl><dt>Returns:</dt><dd>Zero if successful. Otherwise a negative MPR error code.</dd></dl>
    <dl><dt><b>API</b> Stability:</dt><dd>Stable.</dd></dl>
  </div>
</div>
<a name="group___edi_1gad0cad6a7fe8e2568923e47d6e9085ed4"></a>
<div class="api">
  <div class="prototype">
    int
    ediAddTable
(<a href="#group___edi" class="ref">Edi</a> *edi, <a href="osdep.html#group___osdep_1ga0f128c3e0c83721af0220c00554e9c4e" class="ref">cchar</a> *tableName)
  </div>
  <div class="apiDetail">
<p>Add a table to a database.</p>
    <dl><dt>Parameters:</dt><dd>
    <table class="parameters" title="Parameters">
    <tr><td class="param">edi</td><td>Database handle.</td>
    <tr><td class="param">tableName</td><td>Database table name. Table names should be singular. Certain routines like ediJoin rely on being able to map foreign key fields of the form NameId by converting the Name to a database table.</td>
    </table></dd></dl>
    <dl><dt>Returns:</dt><dd>Zero if successful. Otherwise a negative MPR error code.</dd></dl>
    <dl><dt><b>API</b> Stability:</dt><dd>Stable.</dd></dl>
  </div>
</div>
<a name="group___edi_1ga64cb0410a70843250c9826e8d12e3944"></a>
<div class="api">
  <div class="prototype">
    int
    ediAddValidation
(<a href="#group___edi" class="ref">Edi</a> *edi, <a href="osdep.html#group___osdep_1ga0f128c3e0c83721af0220c00554e9c4e" class="ref">cchar</a> *name, <a href="osdep.html#group___osdep_1ga0f128c3e0c83721af0220c00554e9c4e" class="ref">cchar</a> *tableName, <a href="osdep.html#group___osdep_1ga0f128c3e0c83721af0220c00554e9c4e" class="ref">cchar</a> *columnName, <a href="osdep.html#group___osdep_1ga5272042f7e0f5c53e2fd4b49ff47d92d" class="ref">cvoid</a> *data)
  </div>
  <div class="apiDetail">
<p>Add a validation.</p>
    <dl><dt><b>Description</b>:</dt><dd>Validations are run when calling ediUpdateRec. A validation is used to validate field data using builtin validators.</dd></dl>
    <dl><dt>Parameters:</dt><dd>
    <table class="parameters" title="Parameters">
    <tr><td class="param">edi</td><td>Database handle.</td>
    <tr><td class="param">name</td><td>Validation name. Select from: <ul><li>banned <ndash/> to validate field data against a regular express for banned content. </li><li>boolean <ndash/> to validate field data as &quot;true&quot; or &quot;false&quot; </li><li>date <ndash/> to validate field data as a date or time. </li><li>format <ndash/> to validate field data against a regular expression supplied in the &quot;data&quot; argument </li><li>integer <ndash/> to validate field data as an integral value </li><li>number <ndash/> to validate field data as a number. It may be an integer or floating point number. </li><li>present <ndash/> to validate field data as not null. </li><li>unique <ndash/> to validate field data as being unique in the database table. </li></ul></td>
    <tr><td class="param">tableName</td><td>Database table name.</td>
    <tr><td class="param">columnName</td><td>Database column name.</td>
    <tr><td class="param">data</td><td>Argument data for the validator. For example: the &quot;format&quot; validator requires a regular expression.</td>
    </table></dd></dl>
    <dl><dt>Returns:</dt><dd>Zero if successful. Otherwise a negative MPR error code.</dd></dl>
    <dl><dt><b>API</b> Stability:</dt><dd>Stable.</dd></dl>
  </div>
</div>
<a name="group___edi_1gaf35d7f7eba6e1ea718e0169987807f61"></a>
<div class="api">
  <div class="prototype">
    int
    ediChangeColumn
(<a href="#group___edi" class="ref">Edi</a> *edi, <a href="osdep.html#group___osdep_1ga0f128c3e0c83721af0220c00554e9c4e" class="ref">cchar</a> *tableName, <a href="osdep.html#group___osdep_1ga0f128c3e0c83721af0220c00554e9c4e" class="ref">cchar</a> *columnName, int type, int flags)
  </div>
  <div class="apiDetail">
<p>Change a column schema definition.</p>
    <dl><dt>Parameters:</dt><dd>
    <table class="parameters" title="Parameters">
    <tr><td class="param">edi</td><td>Database handle.</td>
    <tr><td class="param">tableName</td><td>Database table name.</td>
    <tr><td class="param">columnName</td><td>Database column name.</td>
    <tr><td class="param">type</td><td>Column data type. Set to one of EDI_TYPE_BINARY, EDI_TYPE_BOOL, EDI_TYPE_DATE EDI_TYPE_FLOAT, EDI_TYPE_INT, EDI_TYPE_STRING, EDI_TYPE_TEXT.</td>
    <tr><td class="param">flags</td><td>Control column attributes. Set to a set of: EDI_AUTO_INC for auto incrementing columns, EDI_KEY if the column is the key column and/or EDI_INDEX to create an index on the column.</td>
    </table></dd></dl>
    <dl><dt>Returns:</dt><dd>Zero if successful. Otherwise a negative MPR error code.</dd></dl>
    <dl><dt><b>API</b> Stability:</dt><dd>Stable.</dd></dl>
  </div>
</div>
<a name="group___edi_1gab04c94ffae708160834f9ceb0588878d"></a>
<div class="api">
  <div class="prototype">
    <a href="#group___edi" class="ref">Edi</a> *
    * ediClone
(<a href="#group___edi" class="ref">Edi</a> *edi)
  </div>
  <div class="apiDetail">
<p>Clone a database.</p>
    <dl><dt>Parameters:</dt><dd>
    <table class="parameters" title="Parameters">
    <tr><td class="param">edi</td><td>Database to clone.</td>
    </table></dd></dl>
    <dl><dt>Returns:</dt><dd>A copy of the database.</dd></dl>
    <dl><dt><b>API</b> Stability:</dt><dd>Internal.</dd></dl>
  </div>
</div>
<a name="group___edi_1gafcc1f1055e50028a02cb8acc0d1c1bd1"></a>
<div class="api">
  <div class="prototype">
    <a href="#group___edi_grid" class="ref">EdiGrid</a> *
    * ediCloneGrid
(<a href="#group___edi_grid" class="ref">EdiGrid</a> *grid)
  </div>
  <div class="apiDetail">
<p>Clone a grid.</p>
    <dl><dt>Parameters:</dt><dd>
    <table class="parameters" title="Parameters">
    <tr><td class="param">grid</td><td>to clone.</td>
    </table></dd></dl>
    <dl><dt>Returns:</dt><dd>A complete copy of a grid.</dd></dl>
    <dl><dt><b>API</b> Stability:</dt><dd>Stable.</dd></dl>
  </div>
</div>
<a name="group___edi_1ga81b2c711a2a3047672b6c259946be394"></a>
<div class="api">
  <div class="prototype">
    void
    ediClose
(<a href="#group___edi" class="ref">Edi</a> *edi)
  </div>
  <div class="apiDetail">
<p>Close a database.</p>
    <dl><dt>Parameters:</dt><dd>
    <table class="parameters" title="Parameters">
    <tr><td class="param">edi</td><td>Database handle.</td>
    </table></dd></dl>
    <dl><dt><b>API</b> Stability:</dt><dd>Stable.</dd></dl>
  </div>
</div>
<a name="group___edi_1ga32592310371cdb3e6dff99ef4f02edfb"></a>
<div class="api">
  <div class="prototype">
    <a href="#group___edi_grid" class="ref">EdiGrid</a> *
    * ediCreateBareGrid
(<a href="#group___edi" class="ref">Edi</a> *edi, <a href="osdep.html#group___osdep_1ga0f128c3e0c83721af0220c00554e9c4e" class="ref">cchar</a> *tableName, int nrows)
  </div>
  <div class="apiDetail">
<p>Create a bare grid.</p>
    <dl><dt><b>Description</b>:</dt><dd>This creates an empty grid based on the given table&apos;s schema.</dd></dl>
    <dl><dt>Parameters:</dt><dd>
    <table class="parameters" title="Parameters">
    <tr><td class="param">edi</td><td>Database handle.</td>
    <tr><td class="param">tableName</td><td>Database table name.</td>
    <tr><td class="param">nrows</td><td>Number of rows to reserve in the grid.</td>
    </table></dd></dl>
    <dl><dt>Returns:</dt><dd>EdiGrid instance.</dd></dl>
    <dl><dt><b>API</b> Stability:</dt><dd>Stable.</dd></dl>
  </div>
</div>
<a name="group___edi_1gab2307e322966f7d74b2f43d375653c72"></a>
<div class="api">
  <div class="prototype">
    <a href="#group___edi_rec" class="ref">EdiRec</a> *
    * ediCreateBareRec
(<a href="#group___edi" class="ref">Edi</a> *edi, <a href="osdep.html#group___osdep_1ga0f128c3e0c83721af0220c00554e9c4e" class="ref">cchar</a> *tableName, int nfields)
  </div>
  <div class="apiDetail">
<p>Create a bare, free-standing record.</p>
    <dl><dt><b>Description</b>:</dt><dd>This creates an empty record based. The tableName and number of fields are defined in the record, but otherwise, the record&apos;s fields are uninitialized. This API is a low level API used internally by ESP and EDI.</dd></dl>
    <dl><dt>Parameters:</dt><dd>
    <table class="parameters" title="Parameters">
    <tr><td class="param">edi</td><td>Database handle.</td>
    <tr><td class="param">tableName</td><td>Database table name.</td>
    <tr><td class="param">nfields</td><td>Number of fields to reserve in the record.</td>
    </table></dd></dl>
    <dl><dt>Returns:</dt><dd>EdiGrid instance.</dd></dl>
    <dl><dt><b>API</b> Stability:</dt><dd>Stable.</dd></dl>
  </div>
</div>
<a name="group___edi_1ga8b541b7e488761324513d98a940908ee"></a>
<div class="api">
  <div class="prototype">
    <a href="#group___edi_rec" class="ref">EdiRec</a> *
    * ediCreateRec
(<a href="#group___edi" class="ref">Edi</a> *edi, <a href="osdep.html#group___osdep_1ga0f128c3e0c83721af0220c00554e9c4e" class="ref">cchar</a> *tableName)
  </div>
  <div class="apiDetail">
<p>Create a new record based on the table&apos;s schema.</p>
    <dl><dt><b>Description</b>:</dt><dd>This will create an empty record using the given database tableName to supply the record schema. It will not be saved to the database as the field values have not been assigned. Set field values using <a class="ref" href="#group___edi_1gaf4e56d097ffeb991cb11b2b6c102539e">ediSetField</a> and <a class="ref" href="#group___edi_1gaa46e5558798c50a66434aadd3d7628e5">ediSetFields</a> and then save to the database using <a class="ref" href="#group___edi_1ga9b65a775c4ddc081e49b1a55cabc06aa">ediUpdateRec</a>. Create a record based on the table&apos;s schema. Not saved to the database. Use <a class="ref" href="#group___edi_1gab2307e322966f7d74b2f43d375653c72">ediCreateBareRec</a> to create a free-standing record without requiring a database. The record is allocated and room is reserved to store record values. No record field values are stored.</dd></dl>
    <dl><dt>Parameters:</dt><dd>
    <table class="parameters" title="Parameters">
    <tr><td class="param">edi</td><td>Database handle.</td>
    <tr><td class="param">tableName</td><td>Database table name.</td>
    </table></dd></dl>
    <dl><dt>Returns:</dt><dd>Record instance.</dd></dl>
    <dl><dt><b>API</b> Stability:</dt><dd>Stable.</dd></dl>
  </div>
</div>
<a name="group___edi_1gaec3079929130e2f517f56d8c322e2468"></a>
<div class="api">
  <div class="prototype">
    int
    ediDelete
(<a href="#group___edi" class="ref">Edi</a> *edi, <a href="osdep.html#group___osdep_1ga0f128c3e0c83721af0220c00554e9c4e" class="ref">cchar</a> *path)
  </div>
  <div class="apiDetail">
<p>Delete the database at the given path.</p>
    <dl><dt>Parameters:</dt><dd>
    <table class="parameters" title="Parameters">
    <tr><td class="param">edi</td><td>Database handle. This is required to identify the database provider. The database should be closed before deleting.</td>
    <tr><td class="param">path</td><td>Database path name.</td>
    </table></dd></dl>
    <dl><dt>Returns:</dt><dd>Zero if successful. Otherwise a negative MPR error code.</dd></dl>
    <dl><dt><b>API</b> Stability:</dt><dd>Stable.</dd></dl>
  </div>
</div>
<a name="group___edi_1ga21a7e078206b019276d18123e24af1f7"></a>
<div class="api">
  <div class="prototype">
    void
    ediDumpGrid
(<a href="osdep.html#group___osdep_1ga0f128c3e0c83721af0220c00554e9c4e" class="ref">cchar</a> *message, <a href="#group___edi_grid" class="ref">EdiGrid</a> *grid)
  </div>
  <div class="apiDetail">
<p>Display the grid to the debug log.</p>
    <dl><dt><b>Description</b>:</dt><dd>Used for debugging only.</dd></dl>
    <dl><dt>Parameters:</dt><dd>
    <table class="parameters" title="Parameters">
    <tr><td class="param">message</td><td>Prefix message to output.</td>
    <tr><td class="param">grid</td><td>EDI grid.</td>
    </table></dd></dl>
    <dl><dt><b>API</b> Stability:</dt><dd>Stable.</dd></dl>
  </div>
</div>
<a name="group___edi_1ga035889ee66fbb74bfdd9fd71ce4017ea"></a>
<div class="api">
  <div class="prototype">
    void
    ediDumpRec
(<a href="osdep.html#group___osdep_1ga0f128c3e0c83721af0220c00554e9c4e" class="ref">cchar</a> *message, <a href="#group___edi_rec" class="ref">EdiRec</a> *rec)
  </div>
  <div class="apiDetail">
<p>Display a record to the debug log.</p>
    <dl><dt><b>Description</b>:</dt><dd>Used for debugging only.</dd></dl>
    <dl><dt>Parameters:</dt><dd>
    <table class="parameters" title="Parameters">
    <tr><td class="param">message</td><td>Prefix message to output.</td>
    <tr><td class="param">rec</td><td>Record to log.</td>
    </table></dd></dl>
    <dl><dt><b>API</b> Stability:</dt><dd>Stable.</dd></dl>
  </div>
</div>
<a name="group___edi_1ga91b052815699c4c5868518e1fa8dbbc5"></a>
<div class="api">
  <div class="prototype">
    <a href="#group___edi_grid" class="ref">EdiGrid</a> *
    * ediFindGrid
(<a href="#group___edi" class="ref">Edi</a> *edi, <a href="osdep.html#group___osdep_1ga0f128c3e0c83721af0220c00554e9c4e" class="ref">cchar</a> *tableName, <a href="osdep.html#group___osdep_1ga0f128c3e0c83721af0220c00554e9c4e" class="ref">cchar</a> *query)
  </div>
  <div class="apiDetail">
<p>Read matching records in a table.</p>
    <dl><dt><b>Description</b>:</dt><dd>This runs a SQL like query on the database and returns matching records in a grid. The query selects the rows that have matching fields.</dd></dl>
    <dl><dt>Parameters:</dt><dd>
    <table class="parameters" title="Parameters">
    <tr><td class="param">edi</td><td>Database handle.</td>
    <tr><td class="param">tableName</td><td>Database table name.</td>
    <tr><td class="param">query</td><td>SQL like query expression. This arg is a printf style format string. When expanded, this will contain a SQL style query expression of the form: &quot;Field Op Value AND field OP value ... LIMIT offset, limit&quot;. All fields may be matched by using the pseudo column name &quot;*&quot;. Where OP is &quot;==&quot;, &quot;!=&quot;, &quot;&lt;&quot;, &quot;&gt;&quot;, &quot;&lt;=&quot;, &quot;&gt;=&quot; or &quot;&gt;&lt;&quot;.</td>
    </table></dd></dl>
    <dl><dt>Returns:</dt><dd>A grid containing all matching records. Returns NULL if no matching records.</dd></dl>
    <dl><dt><b>API</b> Stability:</dt><dd>Stable.</dd></dl>
  </div>
</div>
<a name="group___edi_1gadb0ddb5aa0224df3b294f759d5a8fb65"></a>
<div class="api">
  <div class="prototype">
    <a href="#group___edi_rec" class="ref">EdiRec</a> *
    * ediFindRec
(<a href="#group___edi" class="ref">Edi</a> *edi, <a href="osdep.html#group___osdep_1ga0f128c3e0c83721af0220c00554e9c4e" class="ref">cchar</a> *tableName, <a href="osdep.html#group___osdep_1ga0f128c3e0c83721af0220c00554e9c4e" class="ref">cchar</a> *query)
  </div>
  <div class="apiDetail">
<p>Read one record.</p>
    <dl><dt><b>Description</b>:</dt><dd>This runs a simple query on the database and selects the first matching record. The query selects a row that has a &quot;field&quot; that matches the given &quot;value&quot;.</dd></dl>
    <dl><dt>Parameters:</dt><dd>
    <table class="parameters" title="Parameters">
    <tr><td class="param">edi</td><td>Database handle.</td>
    <tr><td class="param">tableName</td><td>Database table name.</td>
    <tr><td class="param">query</td><td>SQL like query expression. This arg is a printf style format string. When expanded, this will contain a SQL style query expression of the form: &quot;Field Op Value AND field OP value ... LIMIT offset, limit&quot;. All fields may be matched by using the pseudo column name &quot;*&quot;. Where OP is &quot;==&quot;, &quot;!=&quot;, &quot;&lt;&quot;, &quot;&gt;&quot;, &quot;&lt;=&quot;, &quot;&gt;=&quot; or &quot;&gt;&lt;&quot;.</td>
    </table></dd></dl>
    <dl><dt>Returns:</dt><dd>First matching record. Returns NULL if no matching records.</dd></dl>
    <dl><dt><b>API</b> Stability:</dt><dd>Deprecated.</dd></dl>
  </div>
</div>
<a name="group___edi_1ga5280a23047352db18eb64d243f5504f0"></a>
<div class="api">
  <div class="prototype">
    <a href="osdep.html#group___osdep_1ga0f128c3e0c83721af0220c00554e9c4e" class="ref">cchar</a> *
    * ediFormatField
(<a href="osdep.html#group___osdep_1ga0f128c3e0c83721af0220c00554e9c4e" class="ref">cchar</a> *fmt, <a href="#group___edi_field" class="ref">EdiField</a> *fp)
  </div>
  <div class="apiDetail">
<p>Format a field value.</p>
    <dl><dt>Parameters:</dt><dd>
    <table class="parameters" title="Parameters">
    <tr><td class="param">fmt</td><td>Printf style format string.</td>
    <tr><td class="param">fp</td><td>Field whoes value will be formatted.</td>
    </table></dd></dl>
    <dl><dt>Returns:</dt><dd>Formatted value string.</dd></dl>
    <dl><dt><b>API</b> Stability:</dt><dd>Stable.</dd></dl>
  </div>
</div>
<a name="group___edi_1gaccb6af245d072ef1533dc7087237e798"></a>
<div class="api">
  <div class="prototype">
    <a href="mpr.html#group___mpr_list" class="ref">MprList</a> *
    * ediGetColumns
(<a href="#group___edi" class="ref">Edi</a> *edi, <a href="osdep.html#group___osdep_1ga0f128c3e0c83721af0220c00554e9c4e" class="ref">cchar</a> *tableName)
  </div>
  <div class="apiDetail">
<p>Get a list of database column names.</p>
    <dl><dt>Parameters:</dt><dd>
    <table class="parameters" title="Parameters">
    <tr><td class="param">edi</td><td>Database handle.</td>
    <tr><td class="param">tableName</td><td>Database table name.</td>
    </table></dd></dl>
    <dl><dt>Returns:</dt><dd>An MprList of column names in the given table.</dd></dl>
    <dl><dt><b>API</b> Stability:</dt><dd>Stable.</dd></dl>
  </div>
</div>
<a name="group___edi_1gac764d3271d738b2e6d284e4d49e8b90e"></a>
<div class="api">
  <div class="prototype">
    int
    ediGetColumnSchema
(<a href="#group___edi" class="ref">Edi</a> *edi, <a href="osdep.html#group___osdep_1ga0f128c3e0c83721af0220c00554e9c4e" class="ref">cchar</a> *tableName, <a href="osdep.html#group___osdep_1ga0f128c3e0c83721af0220c00554e9c4e" class="ref">cchar</a> *columnName, int *type, int *flags, int *cid)
  </div>
  <div class="apiDetail">
<p>Get the column schema.</p>
    <dl><dt>Parameters:</dt><dd>
    <table class="parameters" title="Parameters">
    <tr><td class="param">edi</td><td>Database handle.</td>
    <tr><td class="param">tableName</td><td>Database table name.</td>
    <tr><td class="param">columnName</td><td>Database column name.</td>
    <tr><td class="param">type</td><td>Output parameter to receive the column data type. Will be set to one of: EDI_TYPE_BINARY, EDI_TYPE_BOOL, EDI_TYPE_DATE, EDI_TYPE_FLOAT, EDI_TYPE_INT, EDI_TYPE_STRING, EDI_TYPE_TEXT. Set to null if this data is not required.</td>
    <tr><td class="param">flags</td><td>Output parameter to receive the column control flags. Will be set to one or more of: EDI_AUTO_INC, EDI_KEY and/or EDI_INDEX Set to null if this data is not required.</td>
    <tr><td class="param">cid</td><td>Output parameter to receive the ordinal column index in the database table. Set to null if this data is not required.</td>
    </table></dd></dl>
    <dl><dt>Returns:</dt><dd>Zero if successful. Otherwise a negative MPR error code.</dd></dl>
    <dl><dt><b>API</b> Stability:</dt><dd>Stable.</dd></dl>
  </div>
</div>
<a name="group___edi_1ga6b96cf5d529ca63f393fe0e45eff50ff"></a>
<div class="api">
  <div class="prototype">
    <a href="#group___edi_field" class="ref">EdiField</a> *
    * ediGetField
(<a href="#group___edi_rec" class="ref">EdiRec</a> *rec, <a href="osdep.html#group___osdep_1ga0f128c3e0c83721af0220c00554e9c4e" class="ref">cchar</a> *fieldName)
  </div>
  <div class="apiDetail">
<p>Get a record field.</p>
    <dl><dt>Parameters:</dt><dd>
    <table class="parameters" title="Parameters">
    <tr><td class="param">rec</td><td>Database record.</td>
    <tr><td class="param">fieldName</td><td>Field in the record to extract.</td>
    </table></dd></dl>
    <dl><dt>Returns:</dt><dd>An EdiField structure containing the record field value and details.</dd></dl>
    <dl><dt><b>API</b> Stability:</dt><dd>Stable.</dd></dl>
  </div>
</div>
<a name="group___edi_1ga1f563dfa6f4ad87a227f0470b2a9838e"></a>
<div class="api">
  <div class="prototype">
    int
    ediGetFieldType
(<a href="#group___edi_rec" class="ref">EdiRec</a> *rec, <a href="osdep.html#group___osdep_1ga0f128c3e0c83721af0220c00554e9c4e" class="ref">cchar</a> *fieldName)
  </div>
  <div class="apiDetail">
<p>Get the data type of a record field.</p>
    <dl><dt>Parameters:</dt><dd>
    <table class="parameters" title="Parameters">
    <tr><td class="param">rec</td><td>Record to examine.</td>
    <tr><td class="param">fieldName</td><td>Field to examine.</td>
    </table></dd></dl>
    <dl><dt>Returns:</dt><dd>The field type. Returns one of: EDI_TYPE_BINARY, EDI_TYPE_BOOL, EDI_TYPE_DATE, EDI_TYPE_FLOAT, EDI_TYPE_INT, EDI_TYPE_STRING, EDI_TYPE_TEXT.</dd></dl>
    <dl><dt><b>API</b> Stability:</dt><dd>Stable.</dd></dl>
  </div>
</div>
<a name="group___edi_1ga27d4c8e29d1bfd0669d739dc99b0e4ab"></a>
<div class="api">
  <div class="prototype">
    <a href="osdep.html#group___osdep_1ga0f128c3e0c83721af0220c00554e9c4e" class="ref">cchar</a> *
    * ediGetFieldValue
(<a href="#group___edi_rec" class="ref">EdiRec</a> *rec, <a href="osdep.html#group___osdep_1ga0f128c3e0c83721af0220c00554e9c4e" class="ref">cchar</a> *fieldName)
  </div>
  <div class="apiDetail">
<p>Get a field value.</p>
    <dl><dt>Parameters:</dt><dd>
    <table class="parameters" title="Parameters">
    <tr><td class="param">rec</td><td>Database record.</td>
    <tr><td class="param">fieldName</td><td>Field in the record to extract.</td>
    </table></dd></dl>
    <dl><dt>Returns:</dt><dd>A field value as a string.</dd></dl>
    <dl><dt><b>API</b> Stability:</dt><dd>Stable.</dd></dl>
  </div>
</div>
<a name="group___edi_1ga373646e27ebda56dcbdf80d94793526b"></a>
<div class="api">
  <div class="prototype">
    <a href="mpr.html#group___mpr_list" class="ref">MprList</a> *
    * ediGetGridColumns
(<a href="#group___edi_grid" class="ref">EdiGrid</a> *grid)
  </div>
  <div class="apiDetail">
<p>Get a list of grid column names.</p>
    <dl><dt>Parameters:</dt><dd>
    <table class="parameters" title="Parameters">
    <tr><td class="param">grid</td><td>Database grid.</td>
    </table></dd></dl>
    <dl><dt>Returns:</dt><dd>An MprList of column names in the given grid.</dd></dl>
    <dl><dt><b>API</b> Stability:</dt><dd>Stable.</dd></dl>
  </div>
</div>
<a name="group___edi_1ga7515e433e2812cae0d0a68cf3af899dd"></a>
<div class="api">
  <div class="prototype">
    <a href="mpr.html#struct_mpr_hash" class="ref">MprHash</a> *
    * ediGetRecErrors
(<a href="#group___edi_rec" class="ref">EdiRec</a> *rec)
  </div>
  <div class="apiDetail">
<p>Get record validation errors.</p>
    <dl><dt>Parameters:</dt><dd>
    <table class="parameters" title="Parameters">
    <tr><td class="param">rec</td><td>Database record.</td>
    </table></dd></dl>
    <dl><dt>Returns:</dt><dd>A hash of validation errors. If validation passed, then this call returns NULL.</dd></dl>
    <dl><dt><b>API</b> Stability:</dt><dd>Stable.</dd></dl>
  </div>
</div>
<a name="group___edi_1ga159e08f49d49361fd64b40e5df18b644"></a>
<div class="api">
  <div class="prototype">
    int
    ediGetTableDimensions
(<a href="#group___edi" class="ref">Edi</a> *edi, <a href="osdep.html#group___osdep_1ga0f128c3e0c83721af0220c00554e9c4e" class="ref">cchar</a> *tableName, int *numRows, int *numCols)
  </div>
  <div class="apiDetail">
<p>Get table dimensions information.</p>
    <dl><dt>Parameters:</dt><dd>
    <table class="parameters" title="Parameters">
    <tr><td class="param">edi</td><td>Database handle.</td>
    <tr><td class="param">tableName</td><td>Database table name.</td>
    <tr><td class="param">numRows</td><td>Output parameter to receive the number of rows in the table Set to null if this data is not required.</td>
    <tr><td class="param">numCols</td><td>Output parameter to receive the number of columns in the table Set to null if this data is not required.</td>
    </table></dd></dl>
    <dl><dt>Returns:</dt><dd>Zero if successful. Otherwise a negative MPR error code.</dd></dl>
    <dl><dt><b>API</b> Stability:</dt><dd>Stable.</dd></dl>
  </div>
</div>
<a name="group___edi_1ga3966b26c7dac47dfd90ab49d2db947a2"></a>
<div class="api">
  <div class="prototype">
    <a href="mpr.html#group___mpr_list" class="ref">MprList</a> *
    * ediGetTables
(<a href="#group___edi" class="ref">Edi</a> *edi)
  </div>
  <div class="apiDetail">
<p>Get a list of database tables.</p>
    <dl><dt>Parameters:</dt><dd>
    <table class="parameters" title="Parameters">
    <tr><td class="param">edi</td><td>Database handle.</td>
    </table></dd></dl>
    <dl><dt>Returns:</dt><dd>An MprList of table names in the database.</dd></dl>
    <dl><dt><b>API</b> Stability:</dt><dd>Stable.</dd></dl>
  </div>
</div>
<a name="group___edi_1ga77ea7a7a45357a2f24d48a37cdaf63b9"></a>
<div class="api">
  <div class="prototype">
    <a href="osdep.html#group___osdep_1ga0f128c3e0c83721af0220c00554e9c4e" class="ref">cchar</a> *
    * ediGetTableSchemaAsJson
(<a href="#group___edi" class="ref">Edi</a> *edi, <a href="osdep.html#group___osdep_1ga0f128c3e0c83721af0220c00554e9c4e" class="ref">cchar</a> *tableName)
  </div>
  <div class="apiDetail">
<p>Get a table schema and format as JSON.</p>
    <dl><dt>Parameters:</dt><dd>
    <table class="parameters" title="Parameters">
    <tr><td class="param">edi</td><td>Database handle.</td>
    <tr><td class="param">tableName</td><td>Name of table to examine.</td>
    </table></dd></dl>
    <dl><dt><b>API</b> Stability:</dt><dd>Stable.</dd></dl>
  </div>
</div>
<a name="group___edi_1ga33a7a71fba3899caa169401f5ff7e2c0"></a>
<div class="api">
  <div class="prototype">
    char *
    * ediGetTypeString
(int type)
  </div>
  <div class="apiDetail">
<p>Convert an EDI type to a string.</p>
    <dl><dt>Parameters:</dt><dd>
    <table class="parameters" title="Parameters">
    <tr><td class="param">type</td><td>Column data type. Set to one of EDI_TYPE_BINARY, EDI_TYPE_BOOL, EDI_TYPE_DATE EDI_TYPE_FLOAT, EDI_TYPE_INT, EDI_TYPE_STRING, EDI_TYPE_TEXT.</td>
    </table></dd></dl>
    <dl><dt>Returns:</dt><dd>Type string. This will be set to one of: &quot;binary&quot;, &quot;bool&quot;, &quot;date&quot;, &quot;float&quot;, &quot;int&quot;, &quot;string&quot; or &quot;text&quot;.</dd></dl>
    <dl><dt><b>API</b> Stability:</dt><dd>Stable.</dd></dl>
  </div>
</div>
<a name="group___edi_1gaf09a23b35d227fc250db135d866355bb"></a>
<div class="api">
  <div class="prototype">
    <a href="osdep.html#group___osdep_1ga0f128c3e0c83721af0220c00554e9c4e" class="ref">cchar</a> *
    * ediGridAsJson
(<a href="#group___edi_grid" class="ref">EdiGrid</a> *grid, int flags)
  </div>
  <div class="apiDetail">
<p>Convert an EDI database grid into a JSON string.</p>
    <dl><dt>Parameters:</dt><dd>
    <table class="parameters" title="Parameters">
    <tr><td class="param">grid</td><td>EDI grid.</td>
    <tr><td class="param">flags</td><td>Reserved. Set to MPR_JSON_PRETTY for a prettier format.</td>
    </table></dd></dl>
    <dl><dt>Returns:</dt><dd>JSON string.</dd></dl>
    <dl><dt><b>API</b> Stability:</dt><dd>Stable.</dd></dl>
  </div>
</div>
<a name="group___edi_1ga7a98c7d38eb38d0cb063e532ad00b3af"></a>
<div class="api">
  <div class="prototype">
    <a href="#group___edi_grid" class="ref">EdiGrid</a> *
    * ediJoin
(<a href="#group___edi" class="ref">Edi</a> *edi, ...)
  </div>
  <div class="apiDetail">
<p>Join grids.</p>
    <dl><dt>Parameters:</dt><dd>
    <table class="parameters" title="Parameters">
    <tr><td class="param">edi</td><td>Database handle.</td>
    <tr><td class="param">...</td><td>Null terminated list of data grids. These are instances of EdiGrid.</td>
    </table></dd></dl>
    <dl><dt>Returns:</dt><dd>A joined grid.</dd></dl>
    <dl><dt><b>API</b> Stability:</dt><dd>Stable.</dd></dl>
  </div>
</div>
<a name="group___edi_1ga7dec1de01e90319b1ff0fe351f83f49e"></a>
<div class="api">
  <div class="prototype">
    int
    ediLoad
(<a href="#group___edi" class="ref">Edi</a> *edi, <a href="osdep.html#group___osdep_1ga0f128c3e0c83721af0220c00554e9c4e" class="ref">cchar</a> *path)
  </div>
  <div class="apiDetail">
<p>Load the database file.</p>
    <dl><dt>Parameters:</dt><dd>
    <table class="parameters" title="Parameters">
    <tr><td class="param">edi</td><td>Database handle.</td>
    <tr><td class="param">path</td><td>Database path name.</td>
    </table></dd></dl>
    <dl><dt>Returns:</dt><dd>Zero if successful. Otherwise a negative MPR error code.</dd></dl>
    <dl><dt><b>API</b> Stability:</dt><dd>Stable.</dd></dl>
  </div>
</div>
<a name="group___edi_1gaa88adbb2470a05da45d468fd9d578672"></a>
<div class="api">
  <div class="prototype">
    int
    ediLookupField
(<a href="#group___edi" class="ref">Edi</a> *edi, <a href="osdep.html#group___osdep_1ga0f128c3e0c83721af0220c00554e9c4e" class="ref">cchar</a> *tableName, <a href="osdep.html#group___osdep_1ga0f128c3e0c83721af0220c00554e9c4e" class="ref">cchar</a> *fieldName)
  </div>
  <div class="apiDetail">
<p>Lookup a column field by name.</p>
    <dl><dt>Parameters:</dt><dd>
    <table class="parameters" title="Parameters">
    <tr><td class="param">edi</td><td>Database handle.</td>
    <tr><td class="param">tableName</td><td>Database table name.</td>
    <tr><td class="param">fieldName</td><td>Database column field name.</td>
    </table></dd></dl>
    <dl><dt>Returns:</dt><dd>The ordinal column index in the table if the column field is found. Otherwise returns a negative MPR error code.</dd></dl>
    <dl><dt><b>API</b> Stability:</dt><dd>Stable.</dd></dl>
  </div>
</div>
<a name="group___edi_1gacd2aff777ea4c70bde7b9b6c9b0de094"></a>
<div class="api">
  <div class="prototype">
    <a href="#struct_edi_provider" class="ref">EdiProvider</a> *
    * ediLookupProvider
(<a href="osdep.html#group___osdep_1ga0f128c3e0c83721af0220c00554e9c4e" class="ref">cchar</a> *providerName)
  </div>
  <div class="apiDetail">
<p>Lookup an EDI provider name.</p>
    <dl><dt>Parameters:</dt><dd>
    <table class="parameters" title="Parameters">
    <tr><td class="param">providerName</td><td>Name of the EDI provider.</td>
    </table></dd></dl>
    <dl><dt>Returns:</dt><dd>The EDI provider object. Returns null if the provider cannot be found.</dd></dl>
    <dl><dt><b>API</b> Stability:</dt><dd>Stable.</dd></dl>
  </div>
</div>
<a name="group___edi_1gacd00541258b1416933db860571939008"></a>
<div class="api">
  <div class="prototype">
    <a href="#group___edi_grid" class="ref">EdiGrid</a> *
    * ediMakeGrid
(<a href="osdep.html#group___osdep_1ga0f128c3e0c83721af0220c00554e9c4e" class="ref">cchar</a> *content)
  </div>
  <div class="apiDetail">
Make a grid.
\par \b Description:
  This call makes a free-standing data grid based on the JSON format content string.
@param content JSON format content string. The content should be an array of objects where each object is a
    set of property names and values.
@return An EdiGrid instance
\par \b Example:
 :
grid = ediMakeGrid(&quot;[ \\ \n
    { id: &apos;1&apos;, country: &apos;Australia&apos; }, \ \n
    { id: &apos;2&apos;, country: &apos;China&apos; }, \ \n
    ]&quot;);
    <dl><dt><b>API</b> Stability:</dt><dd>Stable.</dd></dl>
  </div>
</div>
<a name="group___edi_1gaea9ea34697e6bf20f37346b46db7c655"></a>
<div class="api">
  <div class="prototype">
    <a href="mpr.html#group___mpr_json" class="ref">MprJson</a> *
    * ediMakeJson
(<a href="osdep.html#group___osdep_1ga0f128c3e0c83721af0220c00554e9c4e" class="ref">cchar</a> *fmt, ...)
  </div>
  <div class="apiDetail">
<p>Make a JSON container of property values.</p>
    <dl><dt><b>Description</b>:</dt><dd>This routine formats the given arguments, parses the result into a JSON object.</dd></dl>
    <dl><dt>Parameters:</dt><dd>
    <table class="parameters" title="Parameters">
    <tr><td class="param">fmt</td><td>Printf style format string.</td>
    <tr><td class="param">...</td><td>arguments.</td>
    </table></dd></dl>
    <dl><dt>Returns:</dt><dd>MprJson instance.</dd></dl>
    <dl><dt><b>API</b> Stability:</dt><dd>Stable.</dd></dl>
  </div>
</div>
<a name="group___edi_1ga1922ba347b5805fc71d6b6a781d62227"></a>
<div class="api">
  <div class="prototype">
    <a href="#group___edi_rec" class="ref">EdiRec</a> *
    * ediMakeRec
(<a href="osdep.html#group___osdep_1ga0f128c3e0c83721af0220c00554e9c4e" class="ref">cchar</a> *content)
  </div>
  <div class="apiDetail">
<p>Make a record.</p>
    <dl><dt><b>Description</b>:</dt><dd>This call makes a free-standing data record based on the JSON format content string.</dd></dl>
    <dl><dt>Parameters:</dt><dd>
    <table class="parameters" title="Parameters">
    <tr><td class="param">content</td><td>JSON format content string. The content should be a set of property names and values.</td>
    </table></dd></dl>
    <dl><dt>Returns:</dt><dd>An EdiRec instance.</dd></dl>
    <dl><dt><b>Example</b>:</dt><dd>: rec = ediMakeRec(&quot;{ id: 1, title: &apos;Message One&apos;, body: &apos;Line one&apos; }&quot;);.</dd></dl>
    <dl><dt><b>API</b> Stability:</dt><dd>Stable.</dd></dl>
  </div>
</div>
<a name="group___edi_1ga70d7dc2a0603130510a147c4aafcf245"></a>
<div class="api">
  <div class="prototype">
    <a href="#group___edi_rec" class="ref">EdiRec</a> *
    * ediMakeRecFromJson
(<a href="osdep.html#group___osdep_1ga0f128c3e0c83721af0220c00554e9c4e" class="ref">cchar</a> *tableName, <a href="mpr.html#group___mpr_json" class="ref">MprJson</a> *fields)
  </div>
  <div class="apiDetail">
<p>Make a record from a JSON fields object.</p>
    <dl><dt><b>Description</b>:</dt><dd>This call makes a free-standing data record based on the JSON fields.</dd></dl>
    <dl><dt>Parameters:</dt><dd>
    <table class="parameters" title="Parameters">
    <tr><td class="param">tableName</td><td>Name of the database table to initialize in the record.</td>
    <tr><td class="param">fields</td><td>JSON object.</td>
    </table></dd></dl>
    <dl><dt>Returns:</dt><dd>An EdiRec instance.</dd></dl>
    <dl><dt><b>API</b> Stability:</dt><dd>Stable.</dd></dl>
    <dl><dt>See Also:</dt><dd>
    <a href="#group___edi_1gacd00541258b1416933db860571939008" class="ref">ediMakeGrid</a>, <a href="#group___edi_1ga1922ba347b5805fc71d6b6a781d62227" class="ref">ediMakeRec</a></dd></dl>
  </div>
</div>
<a name="group___edi_1ga6913a7aa47c80857de9057e5442b5834"></a>
<div class="api">
  <div class="prototype">
    void
    ediManageEdiRec
(<a href="#group___edi_rec" class="ref">EdiRec</a> *rec, int flags)
  </div>
  <div class="apiDetail">
<p>Manage an EdiRec instance for garbage collection.</p>
    <dl><dt>Parameters:</dt><dd>
    <table class="parameters" title="Parameters">
    <tr><td class="param">rec</td><td>Record instance.</td>
    <tr><td class="param">flags</td><td>GC management flag.</td>
    </table></dd></dl>
    <dl><dt><b>API</b> Stability:</dt><dd>Stable.</dd></dl>
  </div>
</div>
<a name="group___edi_1ga4097dbe07be0c7277ca7b4804ebe8b6d"></a>
<div class="api">
  <div class="prototype">
    <a href="#group___edi" class="ref">Edi</a> *
    * ediOpen
(<a href="osdep.html#group___osdep_1ga0f128c3e0c83721af0220c00554e9c4e" class="ref">cchar</a> *source, <a href="osdep.html#group___osdep_1ga0f128c3e0c83721af0220c00554e9c4e" class="ref">cchar</a> *provider, int flags)
  </div>
  <div class="apiDetail">
<p>Open a database.</p>
    <dl><dt><b>Description</b>:</dt><dd>This opens a database using the specified database provider.</dd></dl>
    <dl><dt>Parameters:</dt><dd>
    <table class="parameters" title="Parameters">
    <tr><td class="param">source</td><td>Database path name. If using the &quot;mdb&quot; provider with the EDI_LITERAL flag, then the source argument can be set to a literal JSON database content string.</td>
    <tr><td class="param">provider</td><td>Database provider. Set to &quot;mdb&quot; for the Memory Database or &quot;sqlite&quot; for the SQLite provider.</td>
    <tr><td class="param">flags</td><td>Set to: <ul><li>EDI_CREATE <ndash/> Create database if not present. </li><li>EDI_AUTO_SAVE <ndash/> Auto-save database if modified in memory. This option is only supported by the &quot;mdb&quot; provider. </li><li>EDI_NO_SAVE <ndash/> Prevent saving to disk. This option is only supported by the &quot;mdb&quot; provider. </li><li>EDI_LITERAL <ndash/> Literal schema in ediOpen source parameter. This option is only supported by the &quot;mdb&quot; provider. </li></ul></td>
    </table></dd></dl>
    <dl><dt>Returns:</dt><dd>If successful, returns an EDI database instance object. Otherwise returns zero.</dd></dl>
    <dl><dt><b>API</b> Stability:</dt><dd>Stable.</dd></dl>
  </div>
</div>
<a name="group___edi_1ga9e890e5216c6c01220e6ba150197a0e1"></a>
<div class="api">
  <div class="prototype">
    int
    ediParseTypeString
(<a href="osdep.html#group___osdep_1ga0f128c3e0c83721af0220c00554e9c4e" class="ref">cchar</a> *type)
  </div>
  <div class="apiDetail">
<p>Parse an EDI type string.</p>
    <dl><dt>Parameters:</dt><dd>
    <table class="parameters" title="Parameters">
    <tr><td class="param">type</td><td>Type string set to one of: &quot;binary&quot;, &quot;bool&quot;, &quot;date&quot;, &quot;float&quot;, &quot;int&quot;, &quot;string&quot; or &quot;text&quot;.</td>
    </table></dd></dl>
    <dl><dt>Returns:</dt><dd>Type code. Set to one of EDI_TYPE_BINARY, EDI_TYPE_BOOL, EDI_TYPE_DATE, EDI_TYPE_FLOAT, EDI_TYPE_INT, EDI_TYPE_STRING, EDI_TYPE_TEXT.</dd></dl>
    <dl><dt><b>API</b> Stability:</dt><dd>Stable.</dd></dl>
  </div>
</div>
<a name="group___edi_1ga7566ab902570254700047faaa83376b5"></a>
<div class="api">
  <div class="prototype">
    <a href="#group___edi_grid" class="ref">EdiGrid</a> *
    * ediQuery
(<a href="#group___edi" class="ref">Edi</a> *edi, <a href="osdep.html#group___osdep_1ga0f128c3e0c83721af0220c00554e9c4e" class="ref">cchar</a> *cmd, int argc, <a href="osdep.html#group___osdep_1ga0f128c3e0c83721af0220c00554e9c4e" class="ref">cchar</a> **argv, va_list vargs)
  </div>
  <div class="apiDetail">
<p>Run a database query query.</p>
    <dl><dt><b>Description</b>:</dt><dd>This runs a provider dependant query. For the SDB SQLite provider, this runs an SQL statement. The &quot;mdb&quot; provider does not implement this API. To do queries using the &quot;mdb&quot; provider, use: <a class="ref" href="#group___edi_1gadb0ddb5aa0224df3b294f759d5a8fb65">ediFindRec</a>, <a class="ref" href="#group___edi_1ga91b052815699c4c5868518e1fa8dbbc5">ediFindGrid</a> and <a class="ref" href="#group___edi_1gafe7cfc471e3df12dcd88b28ff01a958d">ediReadField</a>. The query may contain positional parameters via argc/argv or via a va_list. These are recommended to mitigate SQL injection risk.</dd></dl>
    <dl><dt>Parameters:</dt><dd>
    <table class="parameters" title="Parameters">
    <tr><td class="param">edi</td><td>Database handle.</td>
    <tr><td class="param">cmd</td><td>Query command to execute.</td>
    <tr><td class="param">argc</td><td>Number of query parameters in argv.</td>
    <tr><td class="param">argv</td><td>Query parameter arguments.</td>
    <tr><td class="param">vargs</td><td>Query parameters supplied in a NULL terminated va_list.</td>
    </table></dd></dl>
    <dl><dt>Returns:</dt><dd>If succesful, returns tabular data in the form of an EgiGrid structure. Returns NULL on errors.</dd></dl>
    <dl><dt><b>API</b> Stability:</dt><dd>Stable.</dd></dl>
  </div>
</div>
<a name="group___edi_1gafe7cfc471e3df12dcd88b28ff01a958d"></a>
<div class="api">
  <div class="prototype">
    <a href="#group___edi_field" class="ref">EdiField</a>
    ediReadField
(<a href="#group___edi" class="ref">Edi</a> *edi, <a href="osdep.html#group___osdep_1ga0f128c3e0c83721af0220c00554e9c4e" class="ref">cchar</a> *tableName, <a href="osdep.html#group___osdep_1ga0f128c3e0c83721af0220c00554e9c4e" class="ref">cchar</a> *key, <a href="osdep.html#group___osdep_1ga0f128c3e0c83721af0220c00554e9c4e" class="ref">cchar</a> *fieldName)
  </div>
  <div class="apiDetail">
<p>Read a field from the database.</p>
    <dl><dt><b>Description</b>:</dt><dd>This reads a field from the database.</dd></dl>
    <dl><dt>Parameters:</dt><dd>
    <table class="parameters" title="Parameters">
    <tr><td class="param">edi</td><td>Database handle.</td>
    <tr><td class="param">tableName</td><td>Database table name.</td>
    <tr><td class="param">key</td><td>Row key column value to read.</td>
    <tr><td class="param">fieldName</td><td>Column name to read.</td>
    </table></dd></dl>
    <dl><dt>Returns:</dt><dd>Field value or null if the no record is found. May return null or empty if the field is null or empty.</dd></dl>
    <dl><dt><b>API</b> Stability:</dt><dd>Stable.</dd></dl>
  </div>
</div>
<a name="group___edi_1ga3b77af448ef24198f3ac8984ac42f40d"></a>
<div class="api">
  <div class="prototype">
    <a href="osdep.html#group___osdep_1ga0f128c3e0c83721af0220c00554e9c4e" class="ref">cchar</a> *
    * ediReadFieldValue
(<a href="#group___edi" class="ref">Edi</a> *edi, <a href="osdep.html#group___osdep_1ga0f128c3e0c83721af0220c00554e9c4e" class="ref">cchar</a> *fmt, <a href="osdep.html#group___osdep_1ga0f128c3e0c83721af0220c00554e9c4e" class="ref">cchar</a> *tableName, <a href="osdep.html#group___osdep_1ga0f128c3e0c83721af0220c00554e9c4e" class="ref">cchar</a> *key, <a href="osdep.html#group___osdep_1ga0f128c3e0c83721af0220c00554e9c4e" class="ref">cchar</a> *fieldName, <a href="osdep.html#group___osdep_1ga0f128c3e0c83721af0220c00554e9c4e" class="ref">cchar</a> *defaultValue)
  </div>
  <div class="apiDetail">
<p>Read a formatted field from the database.</p>
    <dl><dt><b>Description</b>:</dt><dd>This reads a field from the database and formats the result using an optional format string. If the field has a null or empty value, the supplied defaultValue will be returned.</dd></dl>
    <dl><dt>Parameters:</dt><dd>
    <table class="parameters" title="Parameters">
    <tr><td class="param">edi</td><td>Database handle.</td>
    <tr><td class="param">fmt</td><td>Reserved and not yet implemented. Set to NULL.</td>
    <tr><td class="param">tableName</td><td>Database table name.</td>
    <tr><td class="param">key</td><td>Row key column value to read.</td>
    <tr><td class="param">fieldName</td><td>Column name to read.</td>
    <tr><td class="param">defaultValue</td><td>Default value to return if the field is null or empty.</td>
    </table></dd></dl>
    <dl><dt>Returns:</dt><dd>Field value or default value if field is null or empty. Returns null if no matching record is found.</dd></dl>
    <dl><dt><b>API</b> Stability:</dt><dd>Stable.</dd></dl>
  </div>
</div>
<a name="group___edi_1ga3e328361501597c363a8be095148d7f6"></a>
<div class="api">
  <div class="prototype">
    <a href="#group___edi_rec" class="ref">EdiRec</a> *
    * ediReadRec
(<a href="#group___edi" class="ref">Edi</a> *edi, <a href="osdep.html#group___osdep_1ga0f128c3e0c83721af0220c00554e9c4e" class="ref">cchar</a> *tableName, <a href="osdep.html#group___osdep_1ga0f128c3e0c83721af0220c00554e9c4e" class="ref">cchar</a> *key)
  </div>
  <div class="apiDetail">
<p>Read a record.</p>
    <dl><dt><b>Description</b>:</dt><dd>Read a record from the given table as identified by the key value.</dd></dl>
    <dl><dt>Parameters:</dt><dd>
    <table class="parameters" title="Parameters">
    <tr><td class="param">edi</td><td>Database handle.</td>
    <tr><td class="param">tableName</td><td>Database table name.</td>
    <tr><td class="param">key</td><td>Key value of the record to read.</td>
    </table></dd></dl>
    <dl><dt>Returns:</dt><dd>Record instance of EdiRec.</dd></dl>
    <dl><dt><b>API</b> Stability:</dt><dd>Stable.</dd></dl>
  </div>
</div>
<a name="group___edi_1ga3329949bda2281f8b85f103f0108ccc1"></a>
<div class="api">
  <div class="prototype">
    <a href="osdep.html#group___osdep_1ga0f128c3e0c83721af0220c00554e9c4e" class="ref">cchar</a> *
    * ediRecAsJson
(<a href="#group___edi_rec" class="ref">EdiRec</a> *rec, int flags)
  </div>
  <div class="apiDetail">
<p>Convert an EDI database record into a JSON string.</p>
    <dl><dt>Parameters:</dt><dd>
    <table class="parameters" title="Parameters">
    <tr><td class="param">rec</td><td>EDI record.</td>
    <tr><td class="param">flags</td><td>Reserved. Set to zero.</td>
    </table></dd></dl>
    <dl><dt>Returns:</dt><dd>JSON string.</dd></dl>
    <dl><dt><b>API</b> Stability:</dt><dd>Stable.</dd></dl>
  </div>
</div>
<a name="group___edi_1ga2e0e7c2d3e5c286a51bdc7c1d18cc34b"></a>
<div class="api">
  <div class="prototype">
    int
    ediRemoveIndex
(<a href="#group___edi" class="ref">Edi</a> *edi, <a href="osdep.html#group___osdep_1ga0f128c3e0c83721af0220c00554e9c4e" class="ref">cchar</a> *tableName, <a href="osdep.html#group___osdep_1ga0f128c3e0c83721af0220c00554e9c4e" class="ref">cchar</a> *indexName)
  </div>
  <div class="apiDetail">
<p>Remove a table index.</p>
    <dl><dt>Parameters:</dt><dd>
    <table class="parameters" title="Parameters">
    <tr><td class="param">edi</td><td>Database handle.</td>
    <tr><td class="param">tableName</td><td>Database table name.</td>
    <tr><td class="param">indexName</td><td>Ignored. Set to null. This call will remove the table index.</td>
    </table></dd></dl>
    <dl><dt>Returns:</dt><dd>Zero if successful. Otherwise a negative MPR error code.</dd></dl>
    <dl><dt><b>API</b> Stability:</dt><dd>Stable.</dd></dl>
  </div>
</div>
<a name="group___edi_1gaaa5333b9b756b1d362d9803830ec3f50"></a>
<div class="api">
  <div class="prototype">
    int
    ediRemoveRec
(<a href="#group___edi" class="ref">Edi</a> *edi, <a href="osdep.html#group___osdep_1ga0f128c3e0c83721af0220c00554e9c4e" class="ref">cchar</a> *tableName, <a href="osdep.html#group___osdep_1ga0f128c3e0c83721af0220c00554e9c4e" class="ref">cchar</a> *key)
  </div>
  <div class="apiDetail">
<p>Delete a row in a database table identified by a key value.</p>
    <dl><dt>Parameters:</dt><dd>
    <table class="parameters" title="Parameters">
    <tr><td class="param">edi</td><td>Database handle.</td>
    <tr><td class="param">tableName</td><td>Database table name.</td>
    <tr><td class="param">key</td><td>Key column value to delete.</td>
    </table></dd></dl>
    <dl><dt>Returns:</dt><dd>Zero if successful. Otherwise a negative MPR error code.</dd></dl>
    <dl><dt><b>API</b> Stability:</dt><dd>Stable.</dd></dl>
  </div>
</div>
<a name="group___edi_1gae965f0739fa618a75fdc0455453dec14"></a>
<div class="api">
  <div class="prototype">
    int
    ediRemoveTable
(<a href="#group___edi" class="ref">Edi</a> *edi, <a href="osdep.html#group___osdep_1ga0f128c3e0c83721af0220c00554e9c4e" class="ref">cchar</a> *tableName)
  </div>
  <div class="apiDetail">
<p>Remove a table from the database.</p>
    <dl><dt>Parameters:</dt><dd>
    <table class="parameters" title="Parameters">
    <tr><td class="param">edi</td><td>Database handle.</td>
    <tr><td class="param">tableName</td><td>Database table name.</td>
    </table></dd></dl>
    <dl><dt>Returns:</dt><dd>Zero if successful. Otherwise a negative MPR error code.</dd></dl>
    <dl><dt><b>API</b> Stability:</dt><dd>Stable.</dd></dl>
  </div>
</div>
<a name="group___edi_1ga6725ef26c5e502c45ed03f42c2f75051"></a>
<div class="api">
  <div class="prototype">
    int
    ediRenameColumn
(<a href="#group___edi" class="ref">Edi</a> *edi, <a href="osdep.html#group___osdep_1ga0f128c3e0c83721af0220c00554e9c4e" class="ref">cchar</a> *tableName, <a href="osdep.html#group___osdep_1ga0f128c3e0c83721af0220c00554e9c4e" class="ref">cchar</a> *columnName, <a href="osdep.html#group___osdep_1ga0f128c3e0c83721af0220c00554e9c4e" class="ref">cchar</a> *newColumnName)
  </div>
  <div class="apiDetail">
<p>Rename a column.</p>
    <dl><dt>Parameters:</dt><dd>
    <table class="parameters" title="Parameters">
    <tr><td class="param">edi</td><td>Database handle.</td>
    <tr><td class="param">tableName</td><td>Database table name.</td>
    <tr><td class="param">columnName</td><td>Database column name.</td>
    <tr><td class="param">newColumnName</td><td>New column name.</td>
    </table></dd></dl>
    <dl><dt>Returns:</dt><dd>Zero if successful. Otherwise a negative MPR error code.</dd></dl>
    <dl><dt><b>API</b> Stability:</dt><dd>Stable.</dd></dl>
  </div>
</div>
<a name="group___edi_1ga42ebae84b96f934005926c25cb568f24"></a>
<div class="api">
  <div class="prototype">
    int
    ediRenameTable
(<a href="#group___edi" class="ref">Edi</a> *edi, <a href="osdep.html#group___osdep_1ga0f128c3e0c83721af0220c00554e9c4e" class="ref">cchar</a> *tableName, <a href="osdep.html#group___osdep_1ga0f128c3e0c83721af0220c00554e9c4e" class="ref">cchar</a> *newTableName)
  </div>
  <div class="apiDetail">
<p>Rename a table.</p>
    <dl><dt>Parameters:</dt><dd>
    <table class="parameters" title="Parameters">
    <tr><td class="param">edi</td><td>Database handle.</td>
    <tr><td class="param">tableName</td><td>Database table name.</td>
    <tr><td class="param">newTableName</td><td>New database table name.</td>
    </table></dd></dl>
    <dl><dt>Returns:</dt><dd>Zero if successful. Otherwise a negative MPR error code.</dd></dl>
    <dl><dt><b>API</b> Stability:</dt><dd>Stable.</dd></dl>
  </div>
</div>
<a name="group___edi_1ga77d616667577833662154d65ef794519"></a>
<div class="api">
  <div class="prototype">
    int
    ediSave
(<a href="#group___edi" class="ref">Edi</a> *edi)
  </div>
  <div class="apiDetail">
<p>Save in-memory database contents to disk.</p>
    <dl><dt><b>Description</b>:</dt><dd>How this call behaves is provider dependant. If the provider is &quot;mdb&quot; and the database is not opened with AutoSave, then this call will save the in-memory contents. If the &quot;mdb&quot; database is opened with AutoSave, then this call will do nothing. For the &quot;sdb&quot; SQLite provider, this call does nothing.</dd></dl>
    <dl><dt>Parameters:</dt><dd>
    <table class="parameters" title="Parameters">
    <tr><td class="param">edi</td><td>Database handle.</td>
    </table></dd></dl>
    <dl><dt>Returns:</dt><dd>Zero if successful. Otherwise a negative MPR error code.</dd></dl>
    <dl><dt><b>API</b> Stability:</dt><dd>Stable.</dd></dl>
  </div>
</div>
<a name="group___edi_1gaf4e56d097ffeb991cb11b2b6c102539e"></a>
<div class="api">
  <div class="prototype">
    <a href="#group___edi_rec" class="ref">EdiRec</a> *
    * ediSetField
(<a href="#group___edi_rec" class="ref">EdiRec</a> *rec, <a href="osdep.html#group___osdep_1ga0f128c3e0c83721af0220c00554e9c4e" class="ref">cchar</a> *fieldName, <a href="osdep.html#group___osdep_1ga0f128c3e0c83721af0220c00554e9c4e" class="ref">cchar</a> *value)
  </div>
  <div class="apiDetail">
<p>Set a record field without writing to the database.</p>
    <dl><dt><b>Description</b>:</dt><dd>This routine updates the record object with the given value. The record will not be written to the database. To write to the database, use <a class="ref" href="#group___edi_1ga9b65a775c4ddc081e49b1a55cabc06aa">ediUpdateRec</a></dd></dl>
    <dl><dt>Parameters:</dt><dd>
    <table class="parameters" title="Parameters">
    <tr><td class="param">rec</td><td>Record to update.</td>
    <tr><td class="param">fieldName</td><td>Record field name to update.</td>
    <tr><td class="param">value</td><td>Value to update.</td>
    </table></dd></dl>
    <dl><dt>Returns:</dt><dd>The record instance if successful, otherwise NULL.</dd></dl>
    <dl><dt><b>API</b> Stability:</dt><dd>Stable.</dd></dl>
  </div>
</div>
<a name="group___edi_1ga1d7f0272d91019359cb1b3627d16883d"></a>
<div class="api">
  <div class="prototype">
    <a href="#group___edi_rec" class="ref">EdiRec</a> *
    * ediSetFieldFmt
(<a href="#group___edi_rec" class="ref">EdiRec</a> *rec, <a href="osdep.html#group___osdep_1ga0f128c3e0c83721af0220c00554e9c4e" class="ref">cchar</a> *fieldName, <a href="osdep.html#group___osdep_1ga0f128c3e0c83721af0220c00554e9c4e" class="ref">cchar</a> *fmt, ...)
  </div>
  <div class="apiDetail">
<p>Set a record field using a format string.</p>
    <dl><dt><b>Description</b>:</dt><dd>This routine updates the record object with the given value. The record will not be written to the database. To write to the database, use <a class="ref" href="#group___edi_1ga9b65a775c4ddc081e49b1a55cabc06aa">ediUpdateRec</a></dd></dl>
    <dl><dt>Parameters:</dt><dd>
    <table class="parameters" title="Parameters">
    <tr><td class="param">rec</td><td>Record to update.</td>
    <tr><td class="param">fieldName</td><td>Record field name to update.</td>
    <tr><td class="param">fmt</td><td>Format string.</td>
    <tr><td class="param">...</td><td>Variable arguments for the format string.</td>
    </table></dd></dl>
    <dl><dt>Returns:</dt><dd>The record instance if successful, otherwise NULL.</dd></dl>
    <dl><dt><b>API</b> Stability:</dt><dd>Stable.</dd></dl>
  </div>
</div>
<a name="group___edi_1gaa46e5558798c50a66434aadd3d7628e5"></a>
<div class="api">
  <div class="prototype">
    <a href="#group___edi_rec" class="ref">EdiRec</a> *
    * ediSetFields
(<a href="#group___edi_rec" class="ref">EdiRec</a> *rec, <a href="mpr.html#group___mpr_json" class="ref">MprJson</a> *data)
  </div>
  <div class="apiDetail">
<p>Set record fields without writing to the database.</p>
    <dl><dt><b>Description</b>:</dt><dd>This routine updates the record object with the given values. The &quot;data&apos; argument supplies
    the fieldNames and values. The data may come from the request params() or it can be manually
    created via #ediMakeJson.
    For example: ediSetFields(rec, mprParseJson(&quot;{ name: &apos;s&apos;, address: &apos;s&apos; }", name, address)) The record will not be written to the database. To write to the database, use <a class="ref" href="#group___edi_1ga9b65a775c4ddc081e49b1a55cabc06aa">ediUpdateRec</a></dd></dl>
    <dl><dt>Parameters:</dt><dd>
    <table class="parameters" title="Parameters">
    <tr><td class="param">rec</td><td>Record to update.</td>
    <tr><td class="param">data</td><td>Json object of field to use for the update.</td>
    </table></dd></dl>
    <dl><dt>Returns:</dt><dd>The record instance if successful, otherwise NULL.</dd></dl>
    <dl><dt><b>API</b> Stability:</dt><dd>Stable.</dd></dl>
  </div>
</div>
<a name="group___edi_1ga8a81197882a1574b7bd5a89dd725d238"></a>
<div class="api">
  <div class="prototype">
    void
    ediSetPrivate
(<a href="#group___edi" class="ref">Edi</a> *edi, <a href="osdep.html#group___osdep_1gad5c9d4ba3dc37783a528b0925dc981a0" class="ref">bool</a> on)
  </div>
  <div class="apiDetail">
<p>Create a private database for each client.</p>
    <dl><dt>Parameters:</dt><dd>
    <table class="parameters" title="Parameters">
    <tr><td class="param">edi</td><td>Database handle.</td>
    <tr><td class="param">on</td><td>Set to true to clone the database for each connected client.</td>
    </table></dd></dl>
    <dl><dt><b>API</b> Stability:</dt><dd>Internal.</dd></dl>
  </div>
</div>
<a name="group___edi_1ga04c6635bccb8f8c2a1b2d5e3bad74bd3"></a>
<div class="api">
  <div class="prototype">
    void
    ediSetReadonly
(<a href="#group___edi" class="ref">Edi</a> *edi, <a href="osdep.html#group___osdep_1gad5c9d4ba3dc37783a528b0925dc981a0" class="ref">bool</a> on)
  </div>
  <div class="apiDetail">
<p>Control whether the database accepts updates.</p>
    <dl><dt>Parameters:</dt><dd>
    <table class="parameters" title="Parameters">
    <tr><td class="param">edi</td><td>Database handle.</td>
    <tr><td class="param">on</td><td>Set to true to make the database readonly, i.e. to disable all updates.</td>
    </table></dd></dl>
    <dl><dt><b>API</b> Stability:</dt><dd>Stable.</dd></dl>
  </div>
</div>
<a name="group___edi_1ga14dfc03675a9312facb1be7dd48f73d6"></a>
<div class="api">
  <div class="prototype">
    int
    ediUpdateField
(<a href="#group___edi" class="ref">Edi</a> *edi, <a href="osdep.html#group___osdep_1ga0f128c3e0c83721af0220c00554e9c4e" class="ref">cchar</a> *tableName, <a href="osdep.html#group___osdep_1ga0f128c3e0c83721af0220c00554e9c4e" class="ref">cchar</a> *key, <a href="osdep.html#group___osdep_1ga0f128c3e0c83721af0220c00554e9c4e" class="ref">cchar</a> *fieldName, <a href="osdep.html#group___osdep_1ga0f128c3e0c83721af0220c00554e9c4e" class="ref">cchar</a> *value)
  </div>
  <div class="apiDetail">
<p>Write a value to a database table field.</p>
    <dl><dt><b>Description</b>:</dt><dd>Update the value of a table field in the selected table row.</dd></dl>
    <dl><dt>Parameters:</dt><dd>
    <table class="parameters" title="Parameters">
    <tr><td class="param">edi</td><td>Database handle.</td>
    <tr><td class="param">tableName</td><td>Database table name.</td>
    <tr><td class="param">key</td><td>Key value for the table row to update.</td>
    <tr><td class="param">fieldName</td><td>Column name to update.</td>
    <tr><td class="param">value</td><td>Value to write to the database field.</td>
    </table></dd></dl>
    <dl><dt>Returns:</dt><dd>Zero if successful. Otherwise a negative MPR error code.</dd></dl>
    <dl><dt><b>API</b> Stability:</dt><dd>Stable.</dd></dl>
  </div>
</div>
<a name="group___edi_1gaa871db11b6b3ea1a177769a09078f732"></a>
<div class="api">
  <div class="prototype">
    int
    ediUpdateFieldFmt
(<a href="#group___edi" class="ref">Edi</a> *edi, <a href="osdep.html#group___osdep_1ga0f128c3e0c83721af0220c00554e9c4e" class="ref">cchar</a> *tableName, <a href="osdep.html#group___osdep_1ga0f128c3e0c83721af0220c00554e9c4e" class="ref">cchar</a> *key, <a href="osdep.html#group___osdep_1ga0f128c3e0c83721af0220c00554e9c4e" class="ref">cchar</a> *fieldName, <a href="osdep.html#group___osdep_1ga0f128c3e0c83721af0220c00554e9c4e" class="ref">cchar</a> *fmt, ...)
  </div>
  <div class="apiDetail">
<p>Write a formatted value to a database table field.</p>
    <dl><dt><b>Description</b>:</dt><dd>Update the value of a table field in the selected table row. Note: field validations are not run.</dd></dl>
    <dl><dt>Parameters:</dt><dd>
    <table class="parameters" title="Parameters">
    <tr><td class="param">edi</td><td>Database handle.</td>
    <tr><td class="param">tableName</td><td>Database table name.</td>
    <tr><td class="param">key</td><td>Key value for the table row to update.</td>
    <tr><td class="param">fieldName</td><td>Column name to update.</td>
    <tr><td class="param">fmt</td><td>Value format string.</td>
    <tr><td class="param">...</td><td>Variable arguments for the format string.</td>
    </table></dd></dl>
    <dl><dt>Returns:</dt><dd>Zero if successful. Otherwise a negative MPR error code.</dd></dl>
    <dl><dt><b>API</b> Stability:</dt><dd>Stable.</dd></dl>
  </div>
</div>
<a name="group___edi_1ga9b65a775c4ddc081e49b1a55cabc06aa"></a>
<div class="api">
  <div class="prototype">
    int
    ediUpdateRec
(<a href="#group___edi" class="ref">Edi</a> *edi, <a href="#group___edi_rec" class="ref">EdiRec</a> *rec)
  </div>
  <div class="apiDetail">
<p>Write a record to the database.</p>
    <dl><dt><b>Description</b>:</dt><dd>If the record is a new record and the &quot;id&quot; column is EDI_AUTO_INC, then the &quot;id&quot; will be assigned prior to saving the record.</dd></dl>
    <dl><dt>Parameters:</dt><dd>
    <table class="parameters" title="Parameters">
    <tr><td class="param">edi</td><td>Database handle.</td>
    <tr><td class="param">rec</td><td>Record to write to the database.</td>
    </table></dd></dl>
    <dl><dt>Returns:</dt><dd>Zero if successful. Otherwise a negative MPR error code.</dd></dl>
    <dl><dt><b>API</b> Stability:</dt><dd>Stable.</dd></dl>
  </div>
</div>
<a name="group___edi_1ga7525ab6e695b51abc1bb342b8f35022b"></a>
<div class="api">
  <div class="prototype">
    <a href="osdep.html#group___osdep_1gad5c9d4ba3dc37783a528b0925dc981a0" class="ref">bool</a>
    ediValidateRec
(<a href="#group___edi_rec" class="ref">EdiRec</a> *rec)
  </div>
  <div class="apiDetail">
<p>Validate a record.</p>
    <dl><dt><b>Description</b>:</dt><dd>Run defined field validations and return true if the record validates. Field validations are defined via <a class="ref" href="#group___edi_1ga64cb0410a70843250c9826e8d12e3944">ediAddValidation</a> calls. If any validations fail, error messages will be added to the record and can be retrieved via <a class="ref" href="#group___edi_1ga7515e433e2812cae0d0a68cf3af899dd">ediGetRecErrors</a></dd></dl>
    <dl><dt>Parameters:</dt><dd>
    <table class="parameters" title="Parameters">
    <tr><td class="param">rec</td><td>Record to validate.</td>
    </table></dd></dl>
    <dl><dt>Returns:</dt><dd>True if all field valiations pass.</dd></dl>
    <dl><dt><b>API</b> Stability:</dt><dd>Stable.</dd></dl>
  </div>
</div>
<a name="group___edi_1gafac7f959a214551acc56fd42a8c0e04e"></a>
<div class="api">
  <div class="prototype">
    int
    edRemoveColumn
(<a href="#group___edi" class="ref">Edi</a> *edi, <a href="osdep.html#group___osdep_1ga0f128c3e0c83721af0220c00554e9c4e" class="ref">cchar</a> *tableName, <a href="osdep.html#group___osdep_1ga0f128c3e0c83721af0220c00554e9c4e" class="ref">cchar</a> *columnName)
  </div>
  <div class="apiDetail">
<p>Remove a column from a table.</p>
    <dl><dt>Parameters:</dt><dd>
    <table class="parameters" title="Parameters">
    <tr><td class="param">edi</td><td>Database handle.</td>
    <tr><td class="param">tableName</td><td>Database table name.</td>
    <tr><td class="param">columnName</td><td>Database column name.</td>
    </table></dd></dl>
    <dl><dt>Returns:</dt><dd>Zero if successful. Otherwise a negative MPR error code.</dd></dl>
    <dl><dt><b>API</b> Stability:</dt><dd>Stable.</dd></dl>
  </div>
</div>
<h2>EdiField</h2>
<a name="group___edi_field"></a>
<div class="api">
  <div class="prototype">EdiField</div>
  <div class="apiDetail">
<p>EDI Record field structure.</p>
    <dl><dt><b>Description</b>:</dt><dd>The EdiField stores record field data and minimal schema information such as the data type and source column name.</dd></dl>
    <dl><dt>Fields:</dt><dd>
    <table class="parameters" title="Parameters">
    <tr><td class="param">int</td><td><td>flags</td><td>
Field flags. 
Flag mask set to EDI_AUTO_INC, EDI_KEY and/or EDI_INDEX.
</td>
    <tr><td class="param">cchar *</td><td><td>name</td><td>
Field name. 
Sourced from the database column name.
</td>
    <tr><td class="param">int</td><td><td>type</td><td>
Field data type. 
Set to one of EDI_TYPE_BINARY, EDI_TYPE_BOOL, EDI_TYPE_DATE EDI_TYPE_FLOAT, EDI_TYPE_INT, EDI_TYPE_STRING, EDI_TYPE_TEXT <br/>
</td>
    <tr><td class="param">int</td><td><td>valid</td><td>
Field validity. 
Set to true if valid.
</td>
    <tr><td class="param">cchar *</td><td><td>value</td><td>
Field data value.
</td>
    </table></dd></dl>
  </div>
</div>
<h2>EdiGrid</h2>
<a name="group___edi_grid"></a>
<div class="api">
  <div class="prototype">EdiGrid</div>
  <div class="apiDetail">
<p>Grid structure.</p>
    <dl><dt><b>Description</b>:</dt><dd>A grid is a tabular (grid) of rows and records. Grids may capture database table data, or may be free-standing without a backing database.</dd></dl>
    <dl><dt>Fields:</dt><dd>
    <table class="parameters" title="Parameters">
    <tr><td class="param">int</td><td><td>count</td><td>
Total count of available records matching query.
</td>
    <tr><td class="param">struct Edi *</td><td><td>edi</td><td>
Database handle.
</td>
    <tr><td class="param">int</td><td><td>flags</td><td>
Grid flags.
</td>
    <tr><td class="param">int</td><td><td>nrecords</td><td>
Number of records in grid.
</td>
    <tr><td class="param">EdiRec *</td><td><td>records[ARRAY_FLEX]</td><td>
Grid records.
</td>
    <tr><td class="param">cchar *</td><td><td>tableName</td><td>
Base table name for grid.
</td>
    </table></dd></dl>
  </div>
</div>
<a name="group___edi_grid_1gafebe73ad2461122ba6e3aa93dfad5cc7"></a>
<div class="api">
  <div class="prototype">
    <a href="#group___edi_grid" class="ref">EdiGrid</a> *
    * ediFilterGridFields
(<a href="#group___edi_grid" class="ref">EdiGrid</a> *grid, <a href="osdep.html#group___osdep_1ga0f128c3e0c83721af0220c00554e9c4e" class="ref">cchar</a> *fields, int include)
  </div>
  <div class="apiDetail">
<p>Filter the fields of a grid.</p>
    <dl><dt>Parameters:</dt><dd>
    <table class="parameters" title="Parameters">
    <tr><td class="param">grid</td><td>Grid to modify and filter.</td>
    <tr><td class="param">fields</td><td>Space separated list of record field names.</td>
    <tr><td class="param">include</td><td>Set to true to interpret the names as fields to include. If false, interpret the names as fields to reject.</td>
    </table></dd></dl>
    <dl><dt>Returns:</dt><dd>The filtered grid. Same reference as the input grid.</dd></dl>
    <dl><dt><b>API</b> Stability:</dt><dd>Internal.</dd></dl>
  </div>
</div>
<a name="group___edi_grid_1ga7473de7608654d33297d63832da397d6"></a>
<div class="api">
  <div class="prototype">
    <a href="osdep.html#group___osdep_1ga0f128c3e0c83721af0220c00554e9c4e" class="ref">cchar</a> *
    * ediGetGridSchemaAsJson
(<a href="#group___edi_grid" class="ref">EdiGrid</a> *grid)
  </div>
  <div class="apiDetail">
<p>Get the schema for a grid and format as JSON.</p>
    <dl><dt>Parameters:</dt><dd>
    <table class="parameters" title="Parameters">
    <tr><td class="param">grid</td><td>Grid to examine.</td>
    </table></dd></dl>
    <dl><dt><b>API</b> Stability:</dt><dd>Stable.</dd></dl>
  </div>
</div>
<a name="group___edi_grid_1gac95c0f63bc7474b5dc6dbc75a300d7bd"></a>
<div class="api">
  <div class="prototype">
    <a href="#group___edi_rec" class="ref">EdiRec</a> *
    * ediGetNextRec
(<a href="#group___edi_grid" class="ref">EdiGrid</a> *grid, <a href="#group___edi_rec" class="ref">EdiRec</a> *rec)
  </div>
  <div class="apiDetail">
<p>Get the next record in a grid This is used as an iterator.</p>
For the first call, set rec to NULL
    <dl><dt>Parameters:</dt><dd>
    <table class="parameters" title="Parameters">
    <tr><td class="param">grid</td><td>Grid whose records are iterated.</td>
    <tr><td class="param">rec</td><td>Record pointer.</td>
    </table></dd></dl>
    <dl><dt>Returns:</dt><dd>The next record object. Returns NULL after the last record.</dd></dl>
    <dl><dt><b>API</b> Stability:</dt><dd>Stable.</dd></dl>
  </div>
</div>
<a name="group___edi_grid_1gae6678ab4640819b370e791819d165652"></a>
<div class="api">
  <div class="prototype">
    <a href="#group___edi_grid" class="ref">EdiGrid</a> *
    * ediPivotGrid
(<a href="#group___edi_grid" class="ref">EdiGrid</a> *grid, int flags)
  </div>
  <div class="apiDetail">
<p>Pivot a grid swapping rows for columns.</p>
    <dl><dt>Parameters:</dt><dd>
    <table class="parameters" title="Parameters">
    <tr><td class="param">grid</td><td>Source grid.</td>
    <tr><td class="param">flags</td><td>Control flags. Set to EDI_PIVOT_FIELD_NAMES to use field names as the first column of data.</td>
    </table></dd></dl>
    <dl><dt>Returns:</dt><dd>New pivoted grid.</dd></dl>
    <dl><dt><b>API</b> Stability:</dt><dd>Stable.</dd></dl>
  </div>
</div>
<h2>EdiRec</h2>
<a name="group___edi_rec"></a>
<div class="api">
  <div class="prototype">EdiRec</div>
  <div class="apiDetail">
<p>Database record structure.</p>
    <dl><dt><b>Description</b>:</dt><dd>Records may capture database row data, or may be free-standing without a backing database.</dd></dl>
    <dl><dt>Fields:</dt><dd>
    <table class="parameters" title="Parameters">
    <tr><td class="param">struct Edi *</td><td><td>edi</td><td>
Database handle.
</td>
    <tr><td class="param"><a class="ref" href="#struct_mpr_hash" external="/Users/mob/dev/mpr/doc/api/mpr.dtags">MprHash</a> *</td><td><td>errors</td><td>
Hash of record errors.
</td>
    <tr><td class="param">EdiField</td><td><td>fields[ARRAY_FLEX]</td><td>
Field records.
</td>
    <tr><td class="param">cchar *</td><td><td>id</td><td>
Record key ID.
</td>
    <tr><td class="param">int</td><td><td>index</td><td>
Grid index for iteration.
</td>
    <tr><td class="param">int</td><td><td>nfields</td><td>
Number of fields in record.
</td>
    <tr><td class="param">cchar *</td><td><td>tableName</td><td>
Base table name for record.
</td>
    </table></dd></dl>
  </div>
</div>
<a name="group___edi_rec_1ga481d6cbeb7c5f33ed0a5eb062ec1081a"></a>
<div class="api">
  <div class="prototype">
    <a href="#group___edi_rec" class="ref">EdiRec</a> *
    * ediFilterRecFields
(<a href="#group___edi_rec" class="ref">EdiRec</a> *rec, <a href="osdep.html#group___osdep_1ga0f128c3e0c83721af0220c00554e9c4e" class="ref">cchar</a> *fields, int include)
  </div>
  <div class="apiDetail">
<p>Filter the fields of a record.</p>
    <dl><dt>Parameters:</dt><dd>
    <table class="parameters" title="Parameters">
    <tr><td class="param">rec</td><td>Record to modify and filter.</td>
    <tr><td class="param">fields</td><td>Space separated list of record field names.</td>
    <tr><td class="param">include</td><td>Set to true to interpret the names as fields to include. If false, interpret the names as fields to reject.</td>
    </table></dd></dl>
    <dl><dt>Returns:</dt><dd>The filtered record. Same reference as the input record.</dd></dl>
    <dl><dt><b>API</b> Stability:</dt><dd>Internal.</dd></dl>
  </div>
</div>
<a name="group___edi_rec_1gacfca01f1e7f38e1e851c5f08a2305a06"></a>
<div class="api">
  <div class="prototype">
    <a href="#group___edi_field" class="ref">EdiField</a> *
    * ediGetNextField
(<a href="#group___edi_rec" class="ref">EdiRec</a> *rec, <a href="#group___edi_field" class="ref">EdiField</a> *fp, int offset)
  </div>
  <div class="apiDetail">
<p>Get the next field in a record This is used as an iterator.</p>
For the first call, set fp to NULL
    <dl><dt>Parameters:</dt><dd>
    <table class="parameters" title="Parameters">
    <tr><td class="param">rec</td><td>Record whose fields are iterated.</td>
    <tr><td class="param">fp</td><td>Field pointer.</td>
    <tr><td class="param">offset</td><td>Initial offset. Set to 1 to step over the ID field.</td>
    </table></dd></dl>
    <dl><dt>Returns:</dt><dd>The next field object. Returns NULL after the last field.</dd></dl>
    <dl><dt><b>API</b> Stability:</dt><dd>Stable.</dd></dl>
  </div>
</div>
<a name="group___edi_rec_1ga077db7249be1c42310b5a77df426f3d6"></a>
<div class="api">
  <div class="prototype">
    <a href="osdep.html#group___osdep_1ga0f128c3e0c83721af0220c00554e9c4e" class="ref">cchar</a> *
    * ediGetRecSchemaAsJson
(<a href="#group___edi_rec" class="ref">EdiRec</a> *rec)
  </div>
  <div class="apiDetail">
<p>Get the schema for a record and format as JSON.</p>
    <dl><dt>Parameters:</dt><dd>
    <table class="parameters" title="Parameters">
    <tr><td class="param">rec</td><td></td>
    </table></dd></dl>
    <dl><dt><b>API</b> Stability:</dt><dd>Stable.</dd></dl>
  </div>
</div>
<h2>EdiService</h2>
<a name="group___edi_service"></a>
<div class="api">
  <div class="prototype">EdiService</div>
  <div class="apiDetail">
<p>Edi service control structure.</p>
    <dl><dt>Fields:</dt><dd>
    <table class="parameters" title="Parameters">
    </table></dd></dl>
  </div>
</div>
<a name="group___edi_service_1ga81c6f760f0e529fb91868fc2caddcec8"></a>
<div class="api">
  <div class="prototype">
    void
    ediAddFieldError
(struct EdiRec *rec, <a href="osdep.html#group___osdep_1ga0f128c3e0c83721af0220c00554e9c4e" class="ref">cchar</a> *field, <a href="osdep.html#group___osdep_1ga0f128c3e0c83721af0220c00554e9c4e" class="ref">cchar</a> *fmt, ...)
  </div>
  <div class="apiDetail">
<p>Add a field error message.</p>
    <dl><dt>Parameters:</dt><dd>
    <table class="parameters" title="Parameters">
    <tr><td class="param">rec</td><td>Record to update.</td>
    <tr><td class="param">field</td><td>Field name for the error message.</td>
    <tr><td class="param">fmt</td><td>Message format string.</td>
    </table></dd></dl>
    <dl><dt><b>API</b> Stability:</dt><dd>Stable.</dd></dl>
  </div>
</div>
<a name="group___edi_service_1ga7c605c7761d7a46a207cb6dd0f71b372"></a>
<div class="api">
  <div class="prototype">
    void
    ediAddProvider
(struct EdiProvider *provider)
  </div>
  <div class="apiDetail">
<p>Add a database provider.</p>
    <dl><dt><b>Description</b>:</dt><dd>This should only be called by database providers.</dd></dl>
    <dl><dt><b>API</b> Stability:</dt><dd>Stable.</dd></dl>
  </div>
</div>
<a name="group___edi_service_1ga01745fce2b5ce0a096f69f9ca830eb55"></a>
<div class="api">
  <div class="prototype">
    <a href="#group___edi_service" class="ref">EdiService</a> *
    * ediCreateService
(void )
  </div>
  <div class="apiDetail">
<p>Create the EDI service.</p>
    <dl><dt>Returns:</dt><dd>EdiService object.</dd></dl>
    <dl><dt><b>API</b> Stability:</dt><dd>Stable.</dd></dl>
  </div>
</div>
<a name="group___edi_service_1ga789f616e9f38aee34d6862bf85ac4742"></a>
<div class="api">
  <div class="prototype">
    void
    ediDefineMigration
(struct Edi *edi, <a href="#edi_8h_1afef50d4216e0abc4595d23366fc7f328" class="ref">EdiMigration</a> forw, <a href="#edi_8h_1afef50d4216e0abc4595d23366fc7f328" class="ref">EdiMigration</a> back)
  </div>
  <div class="apiDetail">
<p>Define database migration callbacks.</p>
    <dl><dt>Parameters:</dt><dd>
    <table class="parameters" title="Parameters">
    <tr><td class="param">edi</td><td>Database handle.</td>
    <tr><td class="param">forw</td><td>Forward migration callback. Of the form: int forw(Edi *edit); A successful return should be zero.</td>
    <tr><td class="param">back</td><td>Backward migration callback. Of the form: int back(Edi *edit); A successful return should be zero.</td>
    </table></dd></dl>
    <dl><dt><b>API</b> Stability:</dt><dd>Stable.</dd></dl>
  </div>
</div>
<a name="group___edi_service_1ga889df64bdd239f71c66b4fa920be8f46"></a>
<div class="api">
  <div class="prototype">
    void
    ediDefineValidation
(<a href="osdep.html#group___osdep_1ga0f128c3e0c83721af0220c00554e9c4e" class="ref">cchar</a> *name, <a href="#group___edi_service_1gad529099ab50bec8c2349eaa82c4a9e0d" class="ref">EdiValidationProc</a> vfn)
  </div>
  <div class="apiDetail">
<p>Define a field validation procedure.</p>
    <dl><dt>Parameters:</dt><dd>
    <table class="parameters" title="Parameters">
    <tr><td class="param">name</td><td>Validation name.</td>
    <tr><td class="param">vfn</td><td>Validation callback to invoke when validating field data.</td>
    </table></dd></dl>
    <dl><dt><b>API</b> Stability:</dt><dd>Stable.</dd></dl>
  </div>
</div>
<h2>Functions</h2>
<h2>Typedefs</h2>
<a name="group___edi_service_1gad529099ab50bec8c2349eaa82c4a9e0d"></a>
<div class="api">
  <div class="prototype">
    typedef cchar *(* EdiValidationProc) (struct EdiValidation *vp, struct EdiRec *rec, cchar *fieldName, cchar *value).
  </div>
  <div class="apiDetail">
<p>Field validation callback procedure.</p>
    <dl><dt>Parameters:</dt><dd>
    <table class="parameters" title="Parameters">
    <tr><td class="param">vp</td><td>Validation structure reference.</td>
    <tr><td class="param">rec</td><td>Record to validate.</td>
    <tr><td class="param">fieldName</td><td>Field name to validate.</td>
    <tr><td class="param">value</td><td>Field value to.</td>
    </table></dd></dl>
    <dl><dt><b>API</b> Stability:</dt><dd>Stable.</dd></dl>
  </div>
</div>
<a name="struct_edi_provider"></a>
<div class="api">
  <div class="prototype">EdiProvider</div>
  <div class="apiDetail">
<p>Database provider interface.</p>
    <dl><dt>Fields:</dt><dd>
    <table class="parameters" title="Parameters">
    </table></dd></dl>
  </div>
</div>
<a name="struct_edi_validation"></a>
<div class="api">
  <div class="prototype">EdiValidation</div>
  <div class="apiDetail">
<p>Validation structure.</p>
    <dl><dt><b>API</b> Stability:</dt><dd>Stable.</dd></dl>
    <dl><dt>Fields:</dt><dd>
    <table class="parameters" title="Parameters">
    <tr><td class="param">cvoid *</td><td><td>data</td><td>
Custom data (managed).
</td>
    <tr><td class="param">cvoid *</td><td><td>mdata</td><td>
Custom data (unmanaged).
</td>
    <tr><td class="param">cchar *</td><td><td>name</td><td>
Validation name.
</td>
    <tr><td class="param"><a class="ref" href="#group___edi_service_1gad529099ab50bec8c2349eaa82c4a9e0d">EdiValidationProc</a></td><td><td>vfn</td><td>
Validation callback procedure.
</td>
    </table></dd></dl>
  </div>
</div>
